-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
87 lines (59 loc) · 1.85 KB
/
Makefile
File metadata and controls
87 lines (59 loc) · 1.85 KB
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
USERID=$(shell id -u)
GROUPID=$(shell id -g)
USERNAME=$(shell whoami)
CONSOLE=php bin/console
EXECROOT=docker-compose exec -u 0:0 php
EXEC=docker-compose exec php
### DOCKER UTILITIES ####
## build containers creating current user in php container
build:
USER_ID=$(USERID) GROUP_ID=$(GROUPID) USERNAME=$(USERNAME) docker-compose build
start:
docker-compose up -d --remove-orphans
# $(EXECROOT) service supervisor start
# $(EXECROOT) ln -s /app/config/packages/dev/messenger_worker.conf /etc/supervisor/conf.d/
# $(EXECROOT) supervisorctl reread
# $(EXECROOT) supervisorctl update
# $(EXECROOT) supervisorctl start all
stop:
docker-compose down
restart: stop start
exec_root:
$(EXECROOT) bash
exec:
$(EXEC) bash
######## PROJECT UTILITIES ########
composer:
$(EXEC) composer install --prefer-dist --no-progress --no-interaction --ignore-platform-reqs
## clear Symfony cache
cc:
$(EXECROOT) rm -rf var/cache/*
$(EXEC) $(CONSOLE) cache:clear
$(EXEC) composer dump-autoload
######## DATABASE ########
fixture:
$(EXEC) $(CONSOLE) hautelook:fixture:load --no-interaction --purge-with-truncate --no-bundles
db-drop:
$(EXEC) $(CONSOLE) doctrine:database:drop --force
db-create:
$(EXEC) $(CONSOLE) doctrine:database:create
db-play-migrations:
$(EXEC) $(CONSOLE) do:mi:mi -n
db-restore: db-drop db-create db-play-migrations
db-restore-with-fixture: db-drop db-create db-play-migrations fixture
######## CONTINUOUS INTEGRATION ########
## Dump php-cs-fixer errors
cs-dump:
$(EXEC) vendor/bin/php-cs-fixer fix --dry-run -v
## Fix php-cs-fixer errors
cs:
$(EXEC) vendor/bin/php-cs-fixer fix -v
## Run phpstan
stan:
$(EXEC) vendor/bin/phpstan analyse src --level 7 -c phpstan.neon
unit-tests:
$(EXEC) bin/phpunit --testsuite unit-tests
functional-tests:
$(EXEC) bin/phpunit --testsuite functional-tests
tests: unit-tests functional-tests
ci: cs-dump stan tests