forked from PAWECOGmbH/saaster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
77 lines (69 loc) · 2.04 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
SHELL := bash
help:
@echo Available targets:
@echo "dev -> Creates a local development environment"
@echo "reinit -> Rebuilds the database"
@echo "seed -> Ability to seed test data"
@echo "clean -> Remove all containers and volumes"
@echo "url -> List of all URLs"
.DEFAULT_GOAL := help
.PHONY: dev reinit seed clean url
dev:
@cd .
@echo Creating local development environment
@echo ------------------------------------------------------
@docker-compose up -d cfml mysql mailslurper
@echo Wait until all containers are ready...
@until curl --output /dev/null --silent --head --fail http://localhost:80; do\
sleep 0.1;\
done
@echo
@echo ------------------------------------------------------
@echo Saaster: http://localhost/login
@echo Mailslurper: http://localhost:9000
@echo Lucee Admin: http://localhost/lucee/admin/server.cfm
@echo ------------------------------------------------------
@echo
reinit:
@cd .
@echo Rebuilding MySQL container
@echo ------------------------------------------------------
@docker-compose rm -svf mysql
@docker-compose up -d mysql
@echo ------------------------------------------------------
seed:
@cd .
@n=0; \
for file in $(notdir $(wildcard db/dev/*.sql)); do \
let "n+=1" ; \
echo "[$$n]" $$file; \
done
@echo "Choose a number: "; \
read number; \
k=0; \
for file in $(notdir $(wildcard db/dev/*.sql)); do \
let "k+=1"; \
if [ "$$k" = "$$number" ]; then \
sqlfile="$$file"; \
echo "[+]" $$sqlfile;\
fi \
done; \
MYSQL_SEED_FILE="$$sqlfile" \
docker-compose up -d db_seeder
@echo Done!
clean:
@cd .
@echo Removing all containers
@echo ------------------------------------------------------
@docker-compose down -v
@echo ------------------------------------------------------
@echo Done!
url:
@cd .
@echo
@echo ------------------------------------------------------
@echo Saaster: http://localhost/login
@echo Mailslurper: http://localhost:9000
@echo Lucee Admin: http://localhost/lucee/admin/server.cfm
@echo ------------------------------------------------------
@echo