-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (39 loc) · 1.8 KB
/
Makefile
File metadata and controls
53 lines (39 loc) · 1.8 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
#!/bin/bash
OS = $(shell uname)
UID = $(shell id -u)
DOCKER_NETWORK = lexthink-php_skeleton-network
DOCKER_PHP = lexthink-php_skeleton-php
help: ## Show this help message
@echo 'usage: make [target]'
@echo
@echo 'targets:'
@egrep '^(.+)\:\ ##\ (.+)' ${MAKEFILE_LIST} | column -t -c 2 -s ':#'
build: ## Rebuilds all the containers
docker network create ${DOCKER_NETWORK} || true
cp -n docker-compose.yaml.dist docker-compose.yaml || true
cp -n .env.dist .env || true
U_ID=${UID} docker-compose build
start: ## Start the containers
docker network create ${DOCKER_NETWORK} || true
cp -n docker-compose.yaml.dist docker-compose.yaml || 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
install: ## Installs composer dependencies
U_ID=${UID} docker exec --user ${UID} ${DOCKER_PHP} composer install --no-interaction
migrations: ## Runs doctrine migrations
U_ID=${UID} docker exec --user ${UID} ${DOCKER_PHP} bin/console doctrine:migration:migrate -n --allow-no-migration
logs: ## Tails the Symfony dev log
U_ID=${UID} docker exec --user ${UID} ${DOCKER_PHP} tail -f var/log/dev.log
bash: ## bash into the be container
U_ID=${UID} docker exec -it --user ${UID} ${DOCKER_PHP} bash
fix-style: ## Fix code style errors using php-cs-fixer and phpcbf
U_ID=${UID} docker exec --user ${UID} ${DOCKER_PHP} composer dev:fix-style
tests: ## Runs the entire test suite
U_ID=${UID} docker exec --user ${UID} ${DOCKER_PHP} composer dev:tests
coverage: ## Runs phpunit with xdebug and storage coverage in var/coverage/html/
U_ID=${UID} docker exec --user ${UID} ${DOCKER_PHP} composer dev:coverage
.PHONY: help build start stop restart install migrations logs bash fix-style tests coverage