-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (45 loc) · 1.18 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
.DEFAULT_GOAL := help
.PHONY: console composer install qa restart start start_containers stop
# Show this help
help:
@cat $(MAKEFILE_LIST) | docker run --rm -i xanders/make-help
##
## Docker
##
# Build the containers
install:
@mkcert "acme.localhost"
@mv "acme.localhost.pem" docker/ssl/certificate.pem
@mv "acme.localhost-key.pem" docker/ssl/certificate-key.pem
@docker compose build
set_permissions:
@docker compose exec php chown -R www-data:www-data /srv/var
# Start the containers
start: start_containers set_permissions
start_containers: compose.yaml
@docker compose up -d --remove-orphans
# Stop the containers
stop:
@docker compose stop
# Restart the containers
restart: stop start
vendor: composer.lock
@docker compose exec php composer install
##
## Tools
##
# Run a console command
# Example: `make composer run="outdated -D"`
composer:
@docker compose exec php composer $(run)
# Run a console command
# Example: `make console run="cache:clear"`
console:
@docker compose exec php bin/console $(run)
# Run a PHP script
# Example: `make php run="vendor/bin/phpunit"`
php:
@docker compose exec php php $(run)
# Run all QA tools
qa:
@docker compose exec php composer qa