@@ -3,9 +3,11 @@ UNAME := $(shell uname)
3
3
DOCKER_COMPOSE := docker compose
4
4
PHP_CLI := $(DOCKER_COMPOSE ) run --rm app
5
5
6
+ include .env
7
+
6
8
.PHONY : help
7
9
help :
8
- @grep -E ' (^[a-zA-Z0-9_-]+:.*?##)|(^##)' $(MAKEFILE_LIST ) | awk ' BEGIN {FS = ":.*?## "; printf "Usage: make \033[32m<target>\033[0m\n"}{printf "\033[32m%-15s \033[0m %s\n", $$1, $$2}' | sed -e ' s/\[32m## /\n[33m/'
10
+ @grep -E ' (^[a-zA-Z0-9_-]+:.*?##)|(^##)' $(firstword $( MAKEFILE_LIST )) | awk ' BEGIN {FS = ":.*?## "; printf "Usage: make \033[32m<target>\033[0m\n"}{printf "\033[32m%-20s \033[0m %s\n", $$1, $$2}' | sed -e ' s/\[32m## /\n[33m/'
9
11
10
12
# # Docker
11
13
.PHONY : up
@@ -20,14 +22,18 @@ down: ## Stop and remove containers.
20
22
ps : # # List active containers.
21
23
$(DOCKER_COMPOSE ) ps
22
24
25
+ .PHONY : build
26
+ build : # # Build images.
27
+ $(DOCKER_COMPOSE ) build
28
+
23
29
# # GdprDump
24
30
.PHONY : dump
25
- dump : .env vendor # # Run bin/gdpr-dump command. Example: "make dump c=test.yaml"
31
+ dump : vendor # # Run bin/gdpr-dump command. Example: "make dump c=test.yaml"
26
32
@$(eval c ?=)
27
33
$(PHP_CLI ) bin/gdpr-dump $(c )
28
34
29
35
.PHONY : compile
30
- compile : .env # # Run bin/compile command.
36
+ compile : # # Run bin/compile command.
31
37
$(PHP_CLI ) composer install --no-dev
32
38
$(PHP_CLI ) bin/compile $(c )
33
39
$(PHP_CLI ) composer install
@@ -39,20 +45,20 @@ composer: ## Run composer. Example: "make composer c=update"
39
45
40
46
# # Code Quality
41
47
.PHONY : analyse
42
- analyse : .env vendor # # Run code analysis tools (parallel-lint, phpcs, phpstan).
48
+ analyse : vendor # # Run code analysis tools (parallel-lint, phpcs, phpstan).
43
49
$(PHP_CLI ) composer audit
44
50
$(PHP_CLI ) vendor/bin/parallel-lint app bin src tests
45
51
$(PHP_CLI ) vendor/bin/phpcs
46
52
$(PHP_CLI ) vendor/bin/phpstan analyse
47
53
48
54
.PHONY : test
49
- test : .env vendor # # Run phpunit.
55
+ test : vendor # # Run phpunit.
50
56
$(PHP_CLI ) vendor/bin/phpunit
51
57
52
- vendor :
58
+ vendor : composer.json
53
59
$(PHP_CLI ) composer install
54
60
55
- .env :
61
+ .env : | .env.dist
56
62
@cp .env.dist .env
57
63
ifeq ($(UNAME ) , Linux)
58
64
@sed -i -e "s/^UID=.*/UID=$$(id -u)/" -e "s/^GID=.*/GID=$$(id -g)/" .env
0 commit comments