11DOCKER_COMPOSE? =docker-compose
22EXEC? =$(DOCKER_COMPOSE ) exec app
3- CONSOLE =bin/console
3+ CONSOLE =php bin/console
44PHPCSFIXER? =$(EXEC ) php -d memory_limit=1024m vendor/bin/php-cs-fixer
55
66.DEFAULT_GOAL := help
77.PHONY : help start stop restart install uninstall reset clear-cache shell clear clean
88.PHONY : db-diff db-migrate db-rollback db-fixtures db-validate
99.PHONY : watch assets assets-build
1010.PHONY : tests lint lint-symfony lint-yaml lint-twig lint-xliff php-cs php-cs-fix security-check test-schema test-all
11- .PHONY : build up perm
12- .PHONY : docker-compose.override.yml
11+ .PHONY : deps
12+ .PHONY : build up perm docker-compose.override.yml
1313
1414help :
1515 @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/'
1616
17+
1718# #
1819# # Project setup
1920# #---------------------------------------------------------------------------
2728restart : # # Restart docker containers
2829 $(DOCKER_COMPOSE ) restart
2930
30- install : docker-compose.override.yml build up vendor perm # # Create and start docker containers
31+ install : docker-compose.override.yml build up deps perm # # Create and start docker containers
3132
3233uninstall : stop # # Remove docker containers
3334 $(DOCKER_COMPOSE ) rm -vf
@@ -48,7 +49,7 @@ clear: perm
4849 rm -f var/.php_cs.cache
4950
5051clean : clear # # Clear and remove dependencies
51- rm -rf vendor
52+ rm -rf vendor node_modules
5253
5354
5455# #
@@ -81,17 +82,18 @@ watch: node_modules
8182assets : node_modules # # Build the development version of the assets
8283 $(EXEC ) yarn dev
8384
84- assets-build : node_modules # # Build the production version of the assets
85+ assets-build : node_modules # # Build the production version of the assets
8586 $(EXEC ) yarn build
8687
88+
8789# #
8890# # Tests
8991# #---------------------------------------------------------------------------
9092
9193tests : # # Run all the PHP tests
9294 $(EXEC ) bin/phpunit
9395
94- lint : lint-symfony php-cs # # Run lint on Twig, YAML, PHP and Javascript files
96+ lint : lint-symfony php-cs # # Run lint on Twig, YAML, XLIFF, and PHP files
9597
9698lint-symfony : lint-yaml lint-twig lint-xliff # # Lint Symfony (Twig and YAML) files
9799
@@ -101,13 +103,13 @@ lint-yaml:
101103lint-twig : # # Lint Twig files
102104 $(EXEC ) $(CONSOLE ) lint:twig templates
103105
104- lint-xliff : # # Lint Translation files
106+ lint-xliff : # # Lint Translation files
105107 $(EXEC ) $(CONSOLE ) lint:xliff translations
106108
107109php-cs : vendor # # Lint PHP code
108110 $(PHPCSFIXER ) fix --diff --dry-run --no-interaction -v
109111
110- php-cs-fix : vendor # # Lint and fix PHP code to follow the convention
112+ php-cs-fix : vendor # # Fix PHP code to follow the convention
111113 $(PHPCSFIXER ) fix
112114
113115security-check : vendor # # Check for vulnerable dependencies
@@ -116,7 +118,15 @@ security-check: vendor
116118test-schema : vendor # # Test the doctrine Schema
117119 $(EXEC ) $(CONSOLE ) doctrine:schema:validate --skip-sync -vvv --no-interaction
118120
119- test-all : lint test-schema security-check tests # # Lint all, check vulnerable dependencies, run PHP tests
121+ test-all : lint test-schema security-check tests # # Lint all, run schema and security check, then unit and functionnal tests
122+
123+
124+ # #
125+ # # Dependencies
126+ # #---------------------------------------------------------------------------
127+
128+ deps : vendor assets # # Install the project dependencies
129+
120130
121131# #
122132
131141 $(DOCKER_COMPOSE ) up -d --remove-orphans
132142
133143perm :
134- $(EXEC ) chmod -R 777 vendor
135- $(EXEC ) chown -R www-data:root vendor
144+ $(EXEC ) chmod -R 777 var public/build node_modules vendor
145+ $(EXEC ) chown -R www-data:root var public/build node_modules vendor
136146
137147docker-compose.override.yml :
138148ifneq ($(wildcard docker-compose.override.yml) ,docker-compose.override.yml)
@@ -147,7 +157,7 @@ vendor: composer.lock
147157 $(EXEC ) composer install -n
148158
149159composer.lock : composer.json
150- @echo compose .lock is not up to date.
160+ @echo composer .lock is not up to date.
151161
152162node_modules : yarn.lock
153163 $(EXEC ) yarn install
0 commit comments