-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
82 lines (58 loc) · 2.2 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
DKC = docker compose
BCL = php bin/console
PHPUNIT = vendor/bin/phpunit
PHPSTAN = vendor/bin/phpstan
PHPCS = vendor/bin/phpcs
##
## ✨✨✨ The Makefile ✨✨✨
##
help: ## Outputs this help screen
@grep -E '(^[a-zA-Z0-9_-]+:.*?##.*$$)|(^##)' Makefile | awk 'BEGIN {FS = ":.*?## "}{printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
##🐳 Docker
copy-compose: ## Makes a copy of the docker-compose/yml.dist file
cp -n docker-compose.yml.dist docker-compose.yml
up: ## Starts the Docker containers
$(DKC) up --detach --remove-orphans
stop: ## Stops the Docker containers
$(DKC) stop
down: ## Downs the Docker containers & volumes
$(DKC) down -v
build: ## Builds the Docker containers
$(DKC) build
docker-restart: dk-stop ## Restarts the Docker containers
docker-restart: dk-up
##🌐 Project
install: build up vendor dk-reload-database ## Gets the project running from scratch
bash: ## Starts a bash on the PHP server
$(DKC) exec server ash
vendor: ## Installs the PHP dependencies
$(DKC) exec server ash -c "composer install"
cc: ## Clears the Symfony cache
$(DKC) exec server ash -c "$(BCL) cache:clear"
_drop-database:
$(BCL) doctrine:database:drop --force
_create-database:
$(BCL) doctrine:database:create
_execute-migrations:
$(BCL) doctrine:migrations:migrate --no-interaction
_reload-database:
$(BCL) doctrine:database:drop --force
$(BCL) doctrine:database:create
$(BCL) doctrine:migrations:migrate --no-interaction
$(BCL) doctrine:fixtures:load --no-interaction
reload-database: ## Reloads a clean database from the fixtures
$(DKC) exec server ash -c "make _reload-database"
migrate: ## Migrates the database to the latest version
$(DKC) exec server ash -c "make _execute-migrations"
make-mig: ## Creates a new migration from the latest schema changes
$(DKC) exec server ash -c "$(BCL) make:migration"
##⛩️ CodeStyle & Tests
phpcs: ## Checks the PSR-12 compliance
$(DKC) exec server ash -c "$(PHPCS) --standard=PSR12 --extensions=php -n src"
phpunit: ## Runs the PHPUnit tests
$(DKC) exec server ash -c "$(PHPUNIT)"
phpstan: ## Runs the PHPStan
$(DKC) exec server ash -c "$(PHPSTAN)"
# These line avoid make to confuse argument with target
%:
@: