-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (25 loc) · 926 Bytes
/
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
.PHONY: *
.DEFAULT_GOAL := help
docker := $(shell if [ `pwd` != "/app" ]; then echo 'docker compose exec php'; fi;)
HELP_FUNCTION = \
%help; \
while(<>) { push @{$$help{$$2 // 'options'}}, [$$1, $$3] if /^(.+)\s*:.*\#\#(?:@(\w+))?\s(.*)$$/ }; \
print "usage: make [target]\n\n"; \
for (keys %help) { \
print "\033[33m $$_:\n"; \
printf " \033[32m%-30s\033[0m %s\n", $$_->[0], $$_->[1] for @{$$help{$$_}} \
}
help: ##@develop Show this help.
@perl -e '$(HELP_FUNCTION)' $(MAKEFILE_LIST)
build: ##@develop Build docker container and detach
docker compose up --build -d
up: ##@develop Docker compose up
docker compose up -d
down: ##@develop Docker compose down
docker compose down
test: ##@develop Run code style test
${docker} ./vendor/bin/php-cs-fixer fix --diff --dry-run
fix-cs: ##@develop Fix code styling
${docker} ./vendor/bin/php-cs-fixer fix
sh: ##@develop Open shell in container
${docker} sh