-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmd.sh
executable file
·98 lines (83 loc) · 1.67 KB
/
cmd.sh
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/bash
function usage() {
echo "Usage: $0 [options]"
echo "Options:"
echo " elminster Use Elminster"
echo " tasha Use Tasha"
echo " docker Use Docker"
echo " -h, --help Show this message"
}
function usage_elminster() {
echo "Usage: $0 elminster [options]"
echo "Options:"
##echo " migrate"
echo " -h, --help Show this message"
}
function usage_docker() {
echo "Usage: $0 docker [options]"
echo "Options:"
echo " -h, --help Show this message"
echo " down down the containers"
echo " up up the containers"
}
function handle_elminster() {
case $1 in
-h|--help)
usage_elminster
;;
migrate-down)
cd ./elminster
make migrate
;;
migrate-up)
cd ./elminster
make migrate-down
;;
*)
usage_elminster
exit 1
;;
esac
}
function handle_docker() {
case $1 in
down)
docker compose -f docker-compose.databases.yaml -f docker-compose.queueservice.yaml down -d
;;
up)
docker compose -f docker-compose.databases.yaml -f docker-compose.queueservice.yaml up -d
;;
*)
usage_elminster
exit 1
;;
esac
}
# function usage_tasha() {
# }
# function usage_owlbear() {
# }
# function usage_bigby() {
# }
function init() {
if [ $# -eq 0 ]; then
usage
exit 1
fi
case $1 in
-h|--help)
usage
;;
elminster)
handle_elminster "$2"
;;
docker)
handle_docker "$2"
;;
*)
usage
exit 1
;;
esac
}
init "$@"