Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
120 lines (83 loc) · 3.79 KB
/
Copy pathMakefile
File metadata and controls
120 lines (83 loc) · 3.79 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
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
116
117
118
119
120
.DEFAULT_GOAL := list
args = `echo "$(filter-out $@,$(MAKECMDGOALS))"`
## PROJECT COMMANDS ##
help: ## Show command list
@make list
install: ## Load composer/node dependencies
@docker-compose exec php composer install
@docker-compose exec php yarn install
asset: ## Compile assets (styles and javacript)
@docker-compose exec php yarn dev
watch: ## Watch for assets changes with webpack
@docker-compose exec php yarn watch
php-cli: ## Get into php container console
@docker-compose exec php bash
nginx-cli: ## Get into nginx container console
@docker-compose exec nginx sh
pg-cli : ## Get into postgres container console
@docker-compose exec postgres bash
hooks: ## Install git hooks scripts locally (location: .git/hooks)
@cp bin/commit-msg .git/hooks/commit-msg
clear-hooks: ## Remove installed git hooks
@rm .git/hooks/commit-msg
clear-app: ## Clear vendor folders, cache, compiled assets
@rm -Rf node_modules/ vendor/ var/* public/build/
code-analyse: ## Analyse code in /src with phpstan
@docker-compose exec php composer code-analyse
code-fix: ## Fix code in /src with php-cs-fixer
@docker-compose exec php composer code-fix
### DOCKER COMMANDS ###
start: ### Run all docker services
@docker-compose up -d
@echo "Server running at http://localhost:8080/"
@sleep 1 && open "http://localhost:8080/"
build: ### Build docker-compose
@docker-compose build --no-cache
stop: ### Stop all docker services
@docker-compose stop
restart: ### Restart all docker services
@docker-compose stop
@docker-compose up -d
down: ### Stop and remove all docker services
@docker-compose down
logs: ### Show logs for all services (5 last lines)
@docker-compose logs --tail=5
status: ### Show services status
@docker-compose ps
reset-volumes: ### Remove all docker volumes related to this project : database and cache (Do not run this command while running services)
@docker volume rm dinofix_app-cache dinofix_db-data
#### SYMFONY COMMANDS ####
run: #### Run symfony command : php bin/console [args..] (ex: make run "make:entity --regenerate")
@echo "Running : php bin/console $(args)"
@docker-compose exec php bin/console $(args)
entity: #### Run make:entity
@docker-compose exec php bin/console make:entity
controller: #### Run make:controller
@docker-compose exec php bin/console make:controller
crud: #### Run make:crud
@docker-compose exec php bin/console make:crud
ddd: #### Run doctrine:database:drop --force
@docker-compose exec php bin/console doctrine:d:d --force
ddc: #### Run doctrine:database:create --force
@docker-compose exec php bin/console doctrine:d:c
dsu: #### Run doctrine:schema:update --force
@docker-compose exec php bin/console doctrine:schema:update --force
migrate: #### Run doctrine:migrations:migrate
@docker-compose exec php bin/console doctrine:migrations:migrate
cache-clear: #### Run cache:clear
@docker-compose exec php bin/console cache:clear
db-check: #### Run doctrine:migrations:status (Check database connection)
@docker-compose exec php bin/console doctrine:migrations:status
routes: #### Run debug:router
@docker-compose exec php bin/console debug:router
fixtures: #### Run doctrine:fixtures:load
@docker-compose exec php bin/console doctrine:fixtures:load --no-interaction
### Display Makefile command list
list:
@echo "Usage: make [command]"
@grep '^##[^#].*##$/' Makefile | sed 's/##/------------/g'
@grep "^.*: ##[^#]" Makefile | sed 's/^\(.*\): ## \(.*\)/\1 \t \2/g' | expand -t30 | tail -r | tail -n +2| tail -r
@grep '^###[^#].*###$/' Makefile | sed 's/###/------------/g'
@grep "^.*: ###[^#]" Makefile | sed 's/^\(.*\): ### \(.*\)/\1 \t \2/g' | expand -t30 | tail -r | tail -n +2| tail -r
@grep '^####[^#].*####$/' Makefile | sed 's/####/------------/g'
@grep "^.*: ####[^#]" Makefile | sed 's/^\(.*\): #### \(.*\)/\1 \t \2/g' | expand -t30 | tail -r | tail -n +2| tail -r