-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
63 lines (44 loc) · 1.36 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
ENV?= dev
BRANCH?= dev
#
# DOCKER VAR
#
DOCKER_COMPOSE?= docker-compose
EXEC?= $(DOCKER_COMPOSE) exec
PHP?= $(EXEC) php
COMPOSER?= $(PHP) composer
ifeq ($(SKIP_DOCKER),true)
PHP= php
COMPOSER= composer
endif
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
##@ Installation
install: build up vendor down ## Install new project with docker
update: vendor up ## update after checkout
##@ Docker
build: ## Build the images
$(DOCKER_COMPOSE) build --no-cache --build-arg APP_USER_ID=$$(id -u) --build-arg APP_USER=$$(id -u -n)
up: ## Up the images
$(DOCKER_COMPOSE) up -d --remove-orphans
down: ## Down the images
$(DOCKER_COMPOSE) down
## don't forget this if you dont want makefile to get files with this name
.PHONY: build up down install vendor
##@ Composer
vendor: composer.lock ## Install composer dependency
$(COMPOSER) install
##@ Utility
bash-php: ## Launch PHP bash
$(PHP) bash
.PHONY: bash-php
##@ CI
ci: ## Launch csfixer and phpstan and javascript quality check
$(COMPOSER) ci
fixer-php: ## Launch csfixer no dry
$(COMPOSER) phpcsfixer
phpstan: ## Launch phpstan
$(COMPOSER) phpstan
.PHONY: ci fixer-php phpstan phptests
phptests:
$(PHP) vendor/bin/phpunit