-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (39 loc) · 1.64 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
#!/bin/bash
OS = $(shell uname)
UID = $(shell id -u)
DOCKER_BE = docker-dev-env-for-symfony-personal-be
help: ## Show this help message
@echo 'usage: make [target]'
@echo
@echo 'targets:'
@egrep '^(.+)\:\ ##\ (.+)' ${MAKEFILE_LIST} | column -t -c 2 -s ':#'
start: ## Start the containers
docker network create docker-dev-env-for-symfony-personal-network || true
cp -n docker-compose.yml.dist docker-compose.yml || true
cp -n .env.dist .env || 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) start
build: ## Rebuilds all the containers
docker network create docker-dev-env-for-symfony-personal-network || true
cp -n docker-compose.yml.dist docker-compose.yml || true
cp -n .env.dist .env || true
U_ID=${UID} docker-compose build
prepare: ## Runs backend commands
$(MAKE) composer-install
$(MAKE) migrations
# Backend commands
composer-install: ## Installs composer dependencies
U_ID=${UID} docker exec --user ${UID} ${DOCKER_BE} composer install --no-interaction
migrations: ## Installs composer dependencies
U_ID=${UID} docker exec --user ${UID} ${DOCKER_BE} bin/console doctrine:migration:migrate -n --allow-no-migration
be-logs: ## Tails the Symfony dev log
U_ID=${UID} docker exec --user ${UID} ${DOCKER_BE} tail -f var/log/dev.log
# End backend commands
ssh-be: ## bash 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 --user ${UID} ${DOCKER_BE} php-cs-fixer fix src --rules=@Symfony
.PHONY: migrations