forked from parti-renaissance/espace-adherent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
115 lines (83 loc) · 2.92 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
FIG=docker-compose
RUN=$(FIG) run --rm app
EXEC=$(FIG) exec app
CONSOLE=bin/console
.DEFAULT_GOAL := help
.PHONY: help start stop reset db db-diff watch clear clean test tu tf tj lint ls ly lt lj build up perm deps
help:
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
start: ## Install and start the project
start: build up db web/built perm
stop: ## Remove docker containers
$(FIG) kill
$(FIG) rm -v --force
reset: ## Reset the whole project
reset: stop start
db: ## Reset the database and load fixtures
db: vendor
$(RUN) php -r "for(;;){if(@fsockopen('db',3306)){break;}}" # Wait for MySQL
$(RUN) $(CONSOLE) doctrine:database:drop --force --if-exists
$(RUN) $(CONSOLE) doctrine:database:create --if-not-exists
$(RUN) $(CONSOLE) doctrine:migrations:migrate -n
$(RUN) $(CONSOLE) doctrine:fixtures:load -n
:##---------------------------------------------------------------------------:
db-diff: ## Generate a migration by comparing your current database to your mapping information.
db-diff: vendor
$(RUN) $(CONSOLE) doctrine:migration:diff
watch: ## Watch the assets and build their development version on change
watch: node_modules
$(RUN) yarn watch
clear: ## Remove all the cache, the logs, the sessions and the built assets
clear: perm
-$(EXEC) rm -rf var/cache/*
-$(EXEC) rm -rf var/sessions/*
-$(EXEC) rm -rf supervisord.log supervisord.pid npm-debug.log .tmp
rm -rf var/logs/*
rm -rf web/built
clean: ## Clear and remove dependencies
clean: clear
rm -rf vendor node_modules
deps: ## Install the project PHP and JS dependencies
deps: vendor web/built
:##---------------------------------------------------------------------------:
test: ## Run the PHP and the Javascript tests
test: tu tf tj
tu: ## Run the PHP unit tests
tu: vendor
$(RUN) vendor/bin/phpunit --exclude-group functionnal
tf: ## Run the PHP functional tests
tf: vendor
$(RUN) vendor/bin/phpunit --group functionnal
tj: ## Run the Javascript tests
tj: node_modules
$(RUN) yarn test
lint: ## Run lint on twig, yaml and Javascript files
lint: lint-sf lint-front
ls: ## Lint Symfony (twig and yaml) files
ls: ly lt
ly:
$(RUN) $(CONSOLE) lint:yaml app/config
lt:
$(RUN) $(CONSOLE) lint:twig app/Resources
lj: ## Lint the Javascript to follow the convention
lj: node_modules
$(RUN) yarn lint
build:
$(FIG) build
up:
$(FIG) up -d
perm:
-$(EXEC) chmod 777 -R var
# Rules from files
vendor: composer.lock
@$(RUN) composer install
composer.lock: composer.json
@echo compose.lock is not up to date.
app/config/parameters.yml: app/config/parameters.yml.dist
@$(RUN) composer run-script post-install-cmd
node_modules: yarn.lock
@$(RUN) yarn install
yarn.lock: package.json
@echo yarn.lock is not up to date.
web/built: front node_modules
@$(RUN) yarn build-dev