|
1 | | -start-dev: hooks |
2 | | - bash ./docker/start_dev.sh |
| 1 | +#-include docker/.env |
3 | 2 |
|
4 | | -start-prod: |
5 | | - bash ./docker/start_prod.sh |
| 3 | +.SILENT: shell analyse clear-cache |
| 4 | +.DEFAULT_GOAL := help |
6 | 5 |
|
7 | | -stop-dev: |
8 | | - cd ./docker/ && docker-compose -f docker-compose.yml -f docker-compose.dev.yml stop |
| 6 | +help: |
| 7 | + @grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/' |
9 | 8 |
|
10 | | -stop-prod: |
11 | | - cd ./docker/ && docker-compose -f docker-compose.yml -f docker-compose.prod.yml stop |
| 9 | +## |
| 10 | +## Project |
| 11 | +##--------------------------------------------------------------------------- |
12 | 12 |
|
13 | | -shell: |
14 | | - cd ./docker/ && docker-compose exec php bash |
| 13 | +install: ## Install the project |
| 14 | +install: hooks |
| 15 | + cd ./docker && ./install.sh |
15 | 16 |
|
16 | | -check: |
17 | | - cd ./docker/ && docker-compose exec -T php make phpcs |
18 | | - cd ./docker/ && docker-compose exec -T php make stan |
19 | | - cd ./docker/ && docker-compose exec -T php make check-doctrine |
| 17 | +start: ## Start the project |
| 18 | +start: hooks |
| 19 | + cd ./docker && ./start.sh |
| 20 | + |
| 21 | +stop: ## Stop the project |
| 22 | +stop: |
| 23 | + cd ./docker && ./stop.sh |
| 24 | + |
| 25 | +restart: ## Restart the project |
| 26 | +restart: stop start |
| 27 | + |
| 28 | +update: ## Update the project |
| 29 | +update: |
| 30 | + cd ./docker && ./update.sh |
20 | 31 |
|
21 | 32 | hooks: |
| 33 | + # Pre commit |
22 | 34 | echo "#!/bin/bash" > .git/hooks/pre-commit |
23 | 35 | echo "make check" >> .git/hooks/pre-commit |
24 | 36 | chmod +x .git/hooks/pre-commit |
25 | 37 |
|
26 | | -phpcs: |
27 | | - vendor/bin/phpcs |
| 38 | +shell: ## Connect to PHP container |
| 39 | +shell: |
| 40 | + cd ./docker && docker-compose exec php bash |
| 41 | + |
| 42 | +warmup-cache: |
| 43 | + bin/console cache:warmup |
| 44 | + |
| 45 | +clear-cache: |
| 46 | + bin/console cache:clear --no-warmup |
| 47 | + |
| 48 | +## |
| 49 | +## Database |
| 50 | +##--------------------------------------------------------------------------- |
28 | 51 |
|
29 | | -stan: |
| 52 | +reset: ## Reset the database (only on container) |
| 53 | +reset: |
| 54 | + bin/console doctrine:database:drop --if-exists --force |
| 55 | + make doctrine-migrations |
| 56 | + |
| 57 | +doctrine-migrations: ## Execute all migrations (only on container) |
| 58 | +doctrine-migrations: |
| 59 | + bin/console doctrine:database:create --if-not-exists |
| 60 | + bin/console doctrine:migration:migrate --allow-no-migration --no-interaction --all-or-nothing |
| 61 | + |
| 62 | +## |
| 63 | +## Code quality (only on PHP test container) |
| 64 | +##--------------------------------------------------------------------------- |
| 65 | + |
| 66 | +check: |
| 67 | + cd ./docker/ && docker-compose exec -T php make clear-cache |
| 68 | + cd ./docker/ && docker-compose exec -T php make lint |
| 69 | + cd ./docker/ && docker-compose exec -T php make analyse |
| 70 | + cd ./docker/ && docker-compose exec -T php make copy-paste |
| 71 | + cd ./docker/ && docker-compose exec -T php make doctrine |
| 72 | + cd ./docker/ && docker-compose exec -T php make security |
| 73 | + |
| 74 | +lint: ## Execute PHPCS |
| 75 | +lint: |
| 76 | + vendor/bin/phpcs -p |
| 77 | + |
| 78 | +fixer: ## Execute PHPCS fixer |
| 79 | +fixer: |
| 80 | + ./vendor/bin/phpcbf -p |
| 81 | + |
| 82 | +analyse: ## Execute PHPStan |
| 83 | +analyse: |
30 | 84 | bin/console cache:warmup --env=dev |
31 | | - vendor/bin/phpstan analyse src --level max -c extension.neon |
| 85 | + vendor/bin/phpstan analyse --memory-limit=4G |
| 86 | + |
| 87 | +doctrine: ## Validate Doctrine schema |
| 88 | +doctrine: reset |
| 89 | + bin/console d:s:v --env=test |
| 90 | + bin/console d:s:u --dump-sql --env=test |
| 91 | + |
| 92 | +copy-paste: ## Check duplicate code |
| 93 | +copy-paste: |
| 94 | + ./bin/phpcpd src \ |
| 95 | + --fuzzy |
32 | 96 |
|
33 | | -check-doctrine: |
34 | | - bin/console d:s:v |
35 | | - bin/console d:s:u --dump-sql |
| 97 | +security: ## Check CVE for vendor dependencies |
| 98 | +security: |
| 99 | + ./bin/security-checker --path=./composer.lock |
0 commit comments