-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (48 loc) · 1.76 KB
/
Makefile
File metadata and controls
65 lines (48 loc) · 1.76 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
.DEFAULT_GOAL := help
include .env
HOST ?= localhost
help:
@grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
.PHONY: help
##
## Setup
## -----
##
start: .env.local up info ## Start development environment
install: .env.local up
sleep 5
docker-compose exec web bash -c "php bin/console doctrine:database:create --no-interaction"
docker-compose exec web bash -c "php bin/console doctrine:migrations:migrate --no-interaction"
.env.local: .env
@if [ -f .env.local ]; then \
echo '\033[1;41mYour .env.local file may be outdated because .env has changed.\033[0m';\
echo '\033[1;41mCheck your .env.local file, or run this command again to ignore.\033[0m';\
touch .env.local;\
exit 1;\
else\
echo cp .env .env.local;\
cp .env .env.local;\
fi
up: ## Run containers
docker-compose up -d
fixtures: ## Run fixtures
docker-compose exec web bash -c "php /var/www/html/bin/console doctrine:fixtures:load --no-interaction"
bdd: ## Reset BDD
docker-compose exec web bash -c "php bin/console doctrine:database:drop --force --no-interaction"
docker-compose exec web bash -c "php bin/console doctrine:database:create --no-interaction"
docker-compose exec web bash -c "php bin/console doctrine:migration:migrate --no-interaction"
docker-compose exec web bash -c "php bin/console doctrine:fixtures:load --no-interaction"
##
## Tools
## -----
##
cc: ## Clear cache
docker-compose exec web bash -c "php bin/console cache:clear"
logs: ## Show logs
docker-compose logs -ft
bash: ## Bash into php container
docker-compose exec web bash
node: ## Bash into node container
docker-compose exec node sh
rewatch: ## Restart node watcher
docker-compose restart -t 1 node