-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
40 lines (29 loc) · 1.18 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
#!/bin/bash
DOCKER_BE = docker-symfony-be
UID = $(shell id -u)
help: ## Show this help message
@echo 'usage: make [target]'
@echo
@echo 'targets:'
@egrep '^(.+)\:\ ##\ (.+)' ${MAKEFILE_LIST} | column -t -c 2 -s ':#'
run: ## Start the containers
docker network create docker-symfony-network || true
U_ID=${UID} docker-compose up -d
stop: ## Stop the containers
U_ID=${UID} docker-compose stop
restart: ## Restart the containers
$(MAKE) stop && $(MAKE) run
build: ## Rebuilds all the containers
U_ID=${UID} docker-compose build
prepare: ## Runs backend commands
$(MAKE) composer-install
# Backend commands
composer-install: ## Installs composer dependencies
U_ID=${UID} docker exec --user ${UID} -it ${DOCKER_BE} composer install --no-scripts --no-interaction --optimize-autoloader
be-logs: ## Tails the Symfony dev log
U_ID=${UID} docker exec -it --user ${UID} ${DOCKER_BE} tail -f var/log/dev.log
# End backend commands
ssh-be: ## ssh's into the be container
U_ID=${UID} docker exec -it --user ${UID} ${DOCKER_BE} bash
code-style: ## Runs php-cs to fix code styling following Symfony rules
U_ID=${UID} docker exec -it --user ${UID} ${DOCKER_BE} php-cs-fixer fix src --rules=@Symfony