-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (38 loc) · 1.63 KB
/
Makefile
File metadata and controls
57 lines (38 loc) · 1.63 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
USER_ID=$(shell id -u)
DC = @USER_ID=$(USER_ID) docker compose
DC_RUN = ${DC} run --rm sio_test
DC_EXEC = ${DC} exec sio_test
.PHONY: help init build up stop start down restart console install test success-message \
doctrine_migrate doctrine_migrate_test doctrine_load_fixtures doctrine_load_fixtures_test
.DEFAULT_GOAL := help
help: ## This help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
init: down build install up doctrine_migrate success-message console ## Initialize environment
build: ## Build services.
${DC} build $(c)
up: ## Create and start services.
${DC} up -d $(c)
stop: ## Stop services.
${DC} stop $(c)
start: ## Start services.
${DC} start $(c)
down: ## Stop and remove containers and volumes.
${DC} down -v $(c)
restart: stop start ## Restart services.
console: ## Login in console.
${DC_EXEC} /bin/bash
install: ## Install dependencies without running the whole application.
${DC_RUN} composer install
doctrine_migrate: # Migrate database
${DC_EXEC} bin/console doctrine:migrations:migrate -q
doctrine_migrate_test: # Migrate database for test
${DC_EXEC} bin/console doctrine:migrations:migrate --env=test -q
doctrine_load_fixtures: doctrine_migrate # Load fixtures for test
${DC_EXEC} bin/console doctrine:fixtures:load -q
doctrine_load_fixtures_test: doctrine_migrate_test # Load fixtures for test
${DC_EXEC} bin/console doctrine:fixtures:load --env=test -q
test: doctrine_load_fixtures_test # Run tests
${DC_EXEC} bin/phpunit
success-message:
@echo "You can now access the application at http://localhost:8337"
@echo "Good luck! 🚀"