-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
70 lines (41 loc) · 1.76 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
code-style:
docker-compose run --rm php /app/vendor/bin/php-cs-fixer -v fix --allow-risky yes
analyse:
docker-compose run --rm php /app/vendor/bin/phpstan analyse -l $(l) src
## -- Composer
composer-install: ## Allows to manually launch the composer install command in case you did some manual changes
docker-compose run --rm composer install $(p)
composer-require: ## Allows to require new composer vendors. Usage: make composer-require p=symfony/assets
docker-compose run --rm composer require $(p)
composer-update: ## Allows to update 1 or all composer vendors. Usage: make compage-update p=symfony/assets (when leaving p empty, it will update all packages)
docker-compose run --rm composer update $(p)
composer:
docker-compose run --rm composer $(p)
## -- Docker compose
build: ## Builds the docker images and executes the vendors
docker-compose build
compose-build: ## Run build and composer install
build
composer-install
upgrade: ## Upgrades the docker images
docker-compose build --pull
docker-compose pull
## -- Docker
start: up
up: ## Up
docker-compose up -d
stop: ## Stops all containers
docker-compose stop
sh: ## Gets inside a container, use 's' variable to select a service. make s=php sh
docker-compose run --rm $(s) sh -l
logs: ## Shows the logs of a container. Use 's' variable to filter on a specific container.
docker-compose logs -f $(s)
## -- Symfony
console: ## Executes the Symfony command
docker-compose exec php sh -lc '/app/bin/console $(c)'
test:
docker-compose exec php sh -lc '/app/vendor/bin/phpunit --configuration /app/phpunit.xml.dist'
## -- browser
open: ## Open the browser on the right port
$(eval PORT := $(shell port=$$(docker-compose port nginx 80) && echo $${port##*:}))
open http://localhost:$(PORT)/index.php