-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (52 loc) · 1.77 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
http_server = localhost
http_port = 8000
php = php
syf = symfony
sy = $(php) bin/console
.DEFAULT_GOAL = help
.PHONY: help
help: ## Affiche cette demande d'aide
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: test
test: vendor/autoload.php ## Execute les tests
$(sy) doctrine:schema:validate --skip-sync
.\vendor\bin\phpunit
.PHONY: dev
dev: vendor/autoload.php ## Lance le serveur de développement
$(php) -S $(http_server):$(http_port) -t public
## -- Symfony
.PHONY: seed
seed: vendor/autoload.php ## Génère les données
$(sy) doctrine:migrations:migrate -q
$(sy) doctrine:schema:validate -q
$(sy) app:seed -q
.PHONY: migrate
migrate: vendor/autoload.php ## Migre vers la base de donnée
$(sy) doctrine:migrations:migrate
.PHONY: migration
migration: vendor/autoload.php ## Génère les migrations vers la base de donnée
$(sy) make:migration
.PHONY: cc
cc: vendor/autoload.php ## Clear le cache de l'application
$(sy) cache:clear
.PHONY: assets
assets: purge ## Initialise les assets avec des liens symboliques
$(sy) assets:install public/ --symlink --relative
.PHONY: purge
purge: vendor/autoload.php ## Nettoie le cache et les logs serveur
rm -rf var/cache/* var/logs/*
## -- Symfony binary
.PHONY: ca-install
ca-install: vendor/autoload.php ## Initialise le certificat SSL HTTPS localement
$(syf) server:ca:install
.PHONY: fixture
fixture: vendor/autoload.php ## Construit la base de donnée
$(sy) doctrine:cache:clear-metadata
$(sy) doctrine:database:create --if-not-exists
$(sy) doctrine:schema:drop --force
$(sy) doctrine:schema:create
$(sy) doctrine:schema:validate
$(sy) doctrine:fixtures:load -n
## -- Dépendances
vendor/autoload.php: composer.lock
composer install