-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
80 lines (59 loc) · 2.1 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
# ----------------
# Make help script
# ----------------
# Output colors
GREEN := $(shell tput -Txterm setaf 2)
WHITE := $(shell tput -Txterm setaf 7)
YELLOW := $(shell tput -Txterm setaf 3)
RESET := $(shell tput -Txterm sgr0)
PROJECT_ROOT ?= /var/www/html/
#
# Dev Environment settings
#
-include .env
#
# Dev Operations
#
default: up
up: ##@docker Start containers and display status.
@echo "Starting up containers for $(PROJECT_NAME)..."
docker-compose up -d --remove-orphans
docker-compose ps
@echo "Site at $(PROJECT_BASE_URL)"
build: ##@docker Start containers and display status.
@echo "Starting up containers for $(PROJECT_NAME)..."
docker-compose up --build -d --remove-orphans
docker-compose ps
install: ##@dev-environment Configure development environment.
make down
make build
cp docker-config/parameters.yml html/app/config/parameters.yml
make fix-permission
make composer-install
make create-database
make update-database
down: stop
fix-permission:
@docker exec -it $(PROJECT_NAME)_php-apache chmod 777 -R var/
create-database:
@docker exec -it $(PROJECT_NAME)_php-apache bash create-databases.sh -y
update-database:
@docker exec -it $(PROJECT_NAME)_php-apache php bin/console doctrine:schema:update --force
stop: ##@docker Stop and remove containers.
@echo "Stopping containers for $(PROJECT_NAME)..."
@docker-compose stop
prune: ##@docker Remove containers for project.
@echo "Removing containers for $(PROJECT_NAME)..."
@docker-compose down -v
ps: ##@docker List containers.
@docker ps --filter name='$(PROJECT_NAME)*'
shell-php: ##@docker Shell into the container. Specify container name.
@docker exec -it $(PROJECT_NAME)_php-apache bash
shell-database: ##@docker Shell into the container. Specify container name.
@docker exec -it database bash
logs: ##@docker Display log.
docker-compose logs
composer-update: ##@dev-environment Run composer update.
docker-compose exec -T php composer update -n --prefer-dist -vvv -d $(PROJECT_ROOT)
composer-install: ##@dev-environment Run composer install
docker-compose exec -T php composer install -n --prefer-dist -vvv -d $(PROJECT_ROOT)