-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
90 lines (78 loc) · 2.29 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Makefile for Docker Nginx PHP Composer MySQL
export CURRENT_UID
CURRENT_UID= $(shell id -u):$(shell id -g)
help:
@echo ""
@echo "usage: make COMMAND"
@echo ""
@echo "Commands:"
@echo " install Install PHP dependencies with composer"
@echo " update Update PHP dependencies with composer"
@echo " autoload Update PHP autoload files"
@echo " test Run PHPUnit Tests"
@echo " cmd Open terminal with php"
install:
@docker run --rm \
-u $(CURRENT_UID) \
-v $(shell pwd):/app \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/group:/etc/group:ro \
grandchef/composer:2.8.2 install --ignore-platform-reqs --no-scripts --no-interaction
update:
@docker run --rm \
-u $(CURRENT_UID) \
-v $(shell pwd):/app \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/group:/etc/group:ro \
grandchef/composer:2.8.2 update --no-scripts --no-interaction
autoload:
@docker run --rm \
-u $(CURRENT_UID) \
-v $(shell pwd):/app \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/group:/etc/group:ro \
grandchef/composer:2.8.2 dump-autoload --no-scripts --no-interaction
test:
@docker run --rm -it \
-u $(CURRENT_UID) \
-v $(shell pwd):/app \
-w /app \
grandchef/php:8.2.2-fpm-dev php ./vendor/bin/phpunit --configuration . --no-coverage --colors=always
cover:
@docker run --rm -it \
-u $(CURRENT_UID) \
-v $(shell pwd):/app \
-w /app \
grandchef/php:8.2.2-fpm-dev bash -c "XDEBUG_MODE=coverage php ./vendor/bin/phpunit --configuration . --coverage-html storage/coverage --colors=always"
analisys:
@docker run --rm -it \
-u $(CURRENT_UID) \
-v $(shell pwd):/app \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/group:/etc/group:ro \
-w /app \
grandchef/composer:2.8.2 composer analysis
check:
@docker run --rm -it \
-u $(CURRENT_UID) \
-v $(shell pwd):/app \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/group:/etc/group:ro \
-w /app \
grandchef/composer:2.8.2 composer check-style
fix:
@docker run --rm -it \
-u $(CURRENT_UID) \
-v $(shell pwd):/app \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/group:/etc/group:ro \
-w /app \
grandchef/composer:2.8.2 composer psr-fix
cmd:
@docker run --rm -it \
-u $(CURRENT_UID) \
-v $(shell pwd):/app \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/group:/etc/group:ro \
-w /app \
grandchef/composer:2.8.2 /bin/bash