-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (41 loc) · 1.68 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
.PHONY: help ps build build-prod start fresh fresh-prod stop restart destroy \
cache cache-clear migrate migrate migrate-fresh tests tests-html
CONTAINER_PHP=app3
CONTAINER_REDIS=redis
CONTAINER_DATABASE=database3
help: ## Print help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-10s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
ps: ## Show containers.
@docker compose ps
build: ## Build all containers for DEV
@docker build --no-cache . -f ./Dockerfile.local
build-prod: ## Build all containers for PROD
@docker build --no-cache . -f ./Dockerfile
start: ## Start all containers
@docker compose up --force-recreate -d
fresh: ## Destroy & recreate all uing dev containers.
make stop
make destroy
make build
make start
fresh-prod: ## Destroy & recreate all using prod containers.
make stop
make destroy
make build-prod
make start
stop: ## Stop all containers
@docker compose stop
restart: stop start ## Restart all containers
destroy: stop ## Destroy all containers
ssh: ## SSH into PHP container
docker exec -it ${CONTAINER_PHP} sh
install: ## Run composer install
docker exec ${CONTAINER_PHP} composer install
migrate: ## Run migration files
docker exec ${CONTAINER_PHP} php artisan migrate
migrate-fresh: ## Clear database and run all migrations
docker exec ${CONTAINER_PHP} php artisan migrate:fresh
tests: ## Run all tests
docker exec ${CONTAINER_PHP} ./vendor/bin/phpunit
tests-html: ## Run tests and generate coverage. Report found in reports/index.html
docker exec ${CONTAINER_PHP} php -d zend_extension=xdebug.so -d xdebug.mode=coverage ./vendor/bin/phpunit --coverage-html reports