This repository has been archived by the owner on Nov 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
69 lines (45 loc) · 1.5 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
#!/usr/bin/make
PHP_CONTAINER = php
EXEC_PHP_FPM = docker exec $(PHP_CONTAINER) sh -c
SHELL = /bin/bash
USER_ID := $(shell id -u)
GROUP_ID := $(shell id -g)
export USER_ID
export GROUP_ID
.PHONY: help
help: ## This help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.DEFAULT_GOAL := help
## ----- Docker ------
build: ## Build containers
docker-compose build
build-nc: ## Build containers without caching
docker-compose build --no-cache
up: ## Start containers
docker-compose up -d
down: ## Stop containers
docker-compose down
sh: ## Run shell on php container
docker exec -it $(PHP_CONTAINER) $(SHELL)
## ----- Composer -----
setup: composer.lock ## Run bin/setup on first start
$(EXEC_PHP_FPM) 'composer setup'
install: composer.lock ## Install vendors according to the current composer.lock file
$(EXEC_PHP_FPM) 'composer install'
update: composer.json ## Update vendors according to the current composer.json file
$(EXEC_PHP_FPM) 'composer update'
test: ## Launch unit test for project
$(EXEC_PHP_FPM) 'composer test'
phpcs: ## Linter
$(EXEC_PHP_FPM) 'composer phpcs'
$(EXEC_PHP_FPM) 'rm .phpcs.cache'
phpstan: ## Linter fix error
$(EXEC_PHP_FPM) 'composer phpstan'
## ----- Symfony ------
cc: ## Clear cache
$(EXEC_PHP_FPM) 'bin/console c:c'
run: ## Run a Symfony command
$(EXEC_PHP_FPM) "bin/console $(filter-out $@,$(MAKECMDGOALS))"
## ----- Divers ------
purge: ## Purge cache and logs
rm -rf var/cache/* var/logs/*