-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (52 loc) · 2.31 KB
/
Copy pathMakefile
File metadata and controls
65 lines (52 loc) · 2.31 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
.PHONY: help
.DEFAULT_GOAL = help
dc = docker-compose
de = $(dc) exec
composer = $(de) php memory_limit=1 /usr/local/bin/composer
## —— Docker 🐳 ———————————————————————————————————————————————————————————————
.PHONY: install
install: ## Installation du projet
$(dc) up -d
$(de) php bash -c 'composer install'
$(de) php bash -c 'npm i && npm run dev'
$(de) php bash -c 'php bin/console key-generate'
.PHONY: build
build: ## Lancer les containers docker au start du projet
$(dc) up -d
$(dc) exec php bash -c 'composer install'
$(dc) exec php bash -c 'npm install && npm run build'
$(dc) exec php bash -c 'php bin/console d:m:m && php bin/console d:f:l'
.PHONY: dev
dev: ## start container
$(dc) up -d
.PHONY: in-dc
in-dc: ## connexion container php
$(de) php bash
.PHONY: delete
delete: ## delete container
$(dc) down
$(dc) kill
$(dc) rm
## —— Quality Assurance 🛠️️ ———————————————————————————————————————————————————————————————
.PHONY: phpstan
phpstan: ## phpstan
vendor/bin/phpstan analyse --memory-limit=2G
.PHONY: phpcs
phpcs: ## PHP_CodeSnifer Geolid flavoured (https://github.com/Geolid/phpcs)
vendor/bin/phpcs
vendor/bin/php-cs-fixer fix --dry-run --diff
.PHONY: phpcs-fix
phpcs-fix: ## Automatically correct coding standard violations
vendor/bin/php-cs-fixer fix
.PHONY: twigcs
twigcs: ## Twigcs (https://github.com/allocine/twigcs)
vendor/bin/twigcs templates
.PHONY: prettier
prettier: ## Format code
npx prettier --check 'assets/**/*.{js,css}' '.prettierrc.json' 'composer.json' 'package.json'
.PHONY: prettier-fix
prettier-fix: ## Format code
npx prettier --write 'assets/**/*.{js,css}' '.prettierrc.json' 'composer.json' 'package.json'
## —— Others 🛠️️ ———————————————————————————————————————————————————————————————
help: ## listing command
@grep -E '(^[a-zA-Z0-9_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}{printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'