-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
executable file
·50 lines (41 loc) · 934 Bytes
/
start.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
#!/bin/sh
initdevs() {
if [ ! -f ./config/devs-envs ]; then
echo "./config/devs-envs not found! Create file with DEVS environment variables"
exit 1
fi
. ./config/devs-envs
}
initcustoms() {
if [ -f ./config/custom-envs ]; then
. ./config/custom-envs
echo "Custom ENVS loaded"
fi
}
initenvs() {
initdevs
initcustoms
}
start() {
if [ ! -f ${DOCKER_COMPOSE_FILE} ]; then
echo "${DOCKER_COMPOSE_FILE} not found! Start gogs from directory with docker-compose files"
exit 1
fi
docker-compose -f ${DOCKER_COMPOSE_FILE} up -d
}
stop() {
docker-compose -f ${DOCKER_COMPOSE_FILE} stop
}
down() {
docker-compose -f ${DOCKER_COMPOSE_FILE} down
}
initenvs
case "$1" in
start) start ;;
stop) stop ;;
down) down ;;
restart) down; start ;;
*) echo "usage: $0 start|stop|restart|down" >&2
exit 1
;;
esac