forked from icon-project/gochain-local
-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_gochain.sh
executable file
·59 lines (50 loc) · 904 Bytes
/
run_gochain.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
#!/bin/bash
TARGET=${TARGET:-single}
usage() {
echo "Usage: $0 [start|stop|pause|unpause|ps]"
exit 1
}
if [ $# -eq 1 ]; then
CMD=$1
else
usage
fi
startDocker() {
echo ">>> START with compose-$1.yml"
docker-compose -f compose-$1.yml up -d
}
stopDocker() {
echo ">>> STOP with compose-$1.yml"
docker-compose -f compose-$1.yml down
}
pauseDocker() {
echo ">>> PAUSE with compose-$1.yml"
docker-compose -f compose-$1.yml pause
}
unpauseDocker() {
echo ">>> UNPAUSE with compose-$1.yml"
docker-compose -f compose-$1.yml unpause
}
psDocker() {
docker-compose -f compose-$1.yml ps
}
case "$CMD" in
start )
startDocker $TARGET
;;
stop )
stopDocker $TARGET
;;
pause )
pauseDocker $TARGET
;;
unpause )
unpauseDocker $TARGET
;;
ps )
psDocker $TARGET
;;
* )
echo "Error: unknown command: $CMD"
usage
esac