-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
79 lines (68 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
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
.PHONY: all distclean help lint lint-fix serve stop test vendor
# include .env
# export $(shell sed 's/=.*//' .env)
PWD := $(shell pwd)
TP_API_DB := ../tp-mysql
all: test
distclean:
@rm -rf ./src/vendor ./src/composer.lock
serve:
@echo "Starting database container..."
@cd $(TP_API_DB) && sudo docker compose up --detach
@echo "Starting PHP/Apache container..."
@cd $(PWD) && sudo docker compose up --detach
@echo
@echo "API database running on tp_mysql:3306"
@echo "Webserver running on https://api.transcribathon.eu.local:4443/v2/"
@echo
@echo "I'm up to no good..."
@echo
stop:
@echo
@echo "Stopping all containers..."
@cd $(TP_API_DB) && sudo docker compose down
@cd $(PWD) && sudo docker compose down
@echo
@echo "...mischief managed."
@echo
test: serve
@clear
@bash docker_artisan.sh test --without-tty
lint: serve
@clear
./src/vendor/bin/pint --test -v src/app src/tests src/routes --preset psr12
lint-fix: serve
@clear
./src/vendor/bin/pint src/app src/tests src/routes --preset psr12
vendor: distclean
@clear
@bash docker_composer.sh install
help:
@echo "Manage project"
@echo ""
@echo "Usage:"
@echo " $$ make [command]"
@echo ""
@echo "Commands:"
@echo ""
@echo " $$ make lint"
@echo " Lint code style"
@echo ""
@echo " $$ make lint-fix"
@echo " Lint and fix code style"
@echo ""
@echo " $$ make distclean"
@echo " Delete installed dependencies"
@echo ""
@echo " $$ make serve"
@echo " Starting the servers"
@echo ""
@echo " $$ make stop"
@echo " Stopping the servers"
@echo ""
@echo " $$ make test"
@echo " Run tests"
@echo ""
@echo " $$ make vendor"
@echo " Install dependencies"
@echo ""