Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Massive update for presthubot #59

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .env.dist

This file was deleted.

12 changes: 0 additions & 12 deletions .gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions .php_cs.dist

This file was deleted.

36 changes: 36 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.DEFAULT_GOAL:=help

REGEX = '(?<=\DB_VOLUME_NAME=)[a-zA-Z0-9\._-]*'
VOLUME := $(shell cat docker/.env | grep -oP ${REGEX})

.PHONY: build
build:
docker-compose build

.PHONY: up
up:
docker-compose up -d

.PHONY: down
down:
docker-compose down

.PHONY: logs
logs:
docker-compose logs -f

.PHONY: bash
bash:
docker exec -ti php-presthubot-container /bin/bash

.PHONY: watch
watch:
docker exec -ti php-presthubot-container npm run watch

.PHONY: dockerstart
dockerstart:
sudo chmod 666 /var/run/docker.sock

.PHONY: dockerkill
dockerkill:
docker kill $(docker ps -q)
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,22 @@ php bin/console github:check:module
| ------------- | ------------- | ------------- |
| Files | .travis.yml | Check if .travis.yml is present<br>Check if `before_deploy` & `deploy` are present in the file |

### Monitor Module
Permits to monitor PrestaShop Modules

```bash
php bin/console github:module:monitor
```

#### Parameters
| Parameter | Required | Notes |
| ------------- | ------------- | ------------- |
| `--ghtoken=<ghtoken>` | Yes/No | Use it or use .env |


#### Informations
Output an index.html file onto a src/docs directory

### Check Repositories
Permits to check PrestaShop Repositories

Expand Down
23 changes: 23 additions & 0 deletions app/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# In all environments, the following files are loaded if they exist,
# the latter taking precedence over the former:
#
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
# https://symfony.com/doc/current/configuration/secrets.html
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=5d55b2eb88f650f10f6c38b036e8eca3
###< symfony/framework-bundle ###

GH_TOKEN=
GH_USERNAME=
6 changes: 6 additions & 0 deletions app/.env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_APP_ENV=panther
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
File renamed without changes.
21 changes: 21 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/.idea/
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###

###> friendsofphp/php-cs-fixer ###
/.php-cs-fixer.php
/.php-cs-fixer.cache
###< friendsofphp/php-cs-fixer ###

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###
13 changes: 13 additions & 0 deletions app/.php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
->exclude('var')
;

return (new PhpCsFixer\Config())
->setRules([
'@Symfony' => true,
])
->setFinder($finder)
;
20 changes: 20 additions & 0 deletions app/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.DEFAULT_GOAL:=help

REGEX = '(?<=\DB_VOLUME_NAME=)[a-zA-Z0-9\._-]*'
VOLUME := $(shell cat docker/.env | grep -oP ${REGEX})

.PHONY: cc
cc:
php bin/console cache:clear

.PHONY: phpcsfixer
phpcsfixer:
php ./vendor/bin/php-cs-fixer fix

.PHONY: phpstan
phpstan:
php ./vendor/bin/phpstan analyse src tests --memory-limit=-1 --level=3

.PHONY: watch
watch:
npm run watch
17 changes: 17 additions & 0 deletions app/bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env php
<?php

use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;

if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
}

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

return function (array $context) {
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);

return new Application($kernel);
};
90 changes: 90 additions & 0 deletions app/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"type": "project",
"license": "proprietary",
"minimum-stability": "stable",
"prefer-stable": true,
"require": {
"php": ">=8.1",
"ext-ctype": "*",
"ext-iconv": "*",
"cache/filesystem-adapter": "^1.1",
"guzzlehttp/guzzle": "^7.5",
"http-interop/http-factory-guzzle": "^1.2",
"justinrainbow/json-schema": "^5.2",
"knplabs/github-api": "^3.8",
"symfony/asset": "6.1.*",
"symfony/console": "6.1.*",
"symfony/dotenv": "6.1.*",
"symfony/flex": "^2",
"symfony/framework-bundle": "6.1.*",
"symfony/property-access": "6.1.*",
"symfony/runtime": "6.1.*",
"symfony/serializer": "6.1.*",
"symfony/twig-bundle": "6.1.*",
"symfony/ux-twig-component": "^2.4",
"symfony/yaml": "6.1.*",
"ext-curl": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.11",
"phpstan/phpstan": "^0.12.75",
"phpunit/phpunit": "9.5.*",
"symfony/maker-bundle": "^1.45",
"symfony/monolog-bundle": "^3.8",
"symfony/stopwatch": "6.1.*",
"symfony/var-dumper": "6.1.*",
"symfony/web-profiler-bundle": "6.1.*"
},
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true,
"symfony/flex": true,
"symfony/runtime": true
},
"optimize-autoloader": true,
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*",
"symfony/polyfill-php73": "*",
"symfony/polyfill-php74": "*",
"symfony/polyfill-php80": "*",
"symfony/polyfill-php81": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "6.1.*"
}
}
}
Loading