docker: update to 2.10.1
[buildbot.git] / docker / buildmaster / files / start.sh
1 #!/usr/bin/env bash
2
3 case "${1:-start}" in
4 reconfig)
5 exec /usr/local/bin/buildbot reconfig /master
6 ;;
7 start)
8 case "${BUILDMASTER_PHASE:-1}" in
9 1|2)
10 cp /phase${BUILDMASTER_PHASE:-1}/config.ini.example /master/
11 ;;
12 *)
13 echo "Invalid BUILDMASTER_PHASE given. Must be either '1' or '2'" >&2
14 exit 1
15 ;;
16 esac
17
18 /usr/local/bin/buildbot create-master --config=/phase${BUILDMASTER_PHASE:-1}/master.cfg /master
19
20 unset BUILDMASTER_PHASE
21
22 rm -f /master/twistd.pid
23 exec /usr/local/bin/buildbot start --nodaemon /master
24 ;;
25 /*)
26 exec "$@"
27 ;;
28 *)
29 echo "Unknown command given. Must be either 'start' or 'reconfig'" >&2
30 exit 1
31 ;;
32 esac