-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbdemo.sh
executable file
·54 lines (46 loc) · 1.24 KB
/
bdemo.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
#!/bin/sh
# Example of how to use bmaster.sh and bslave.sh
# once you've created foo/{buildshim,master.cfg,slot.txt}
# You'll usually give these commands, or ones like them, by hand.
# No commands need be given at system startup; the bots will start automatically.
set -e
set -x
projects="pyflakes hellozlib"
install_and_start()
{
if ! test -f ~/myconfig.json
then
abort "Can't initialize if you haven't put your secrets file at ~/myconfig.json"
fi
sh bmaster.sh install
sh bslave.sh install
for proj in $projects
do
sh bmaster.sh init $proj
sh bslave.sh init $proj
done
sh bservice.sh start
# Eyeball the bots' output to see if there are any obvious errors
for proj in $projects
do
echo =========== Last ten lines of logs for $proj ============
sleep 3
sh blogs.sh $proj tail
done
}
stop_and_uninstall()
{
sh bservice.sh stop || true
for proj in $projects
do
sh bmaster.sh uninit $proj || true
sh bslave.sh uninit $proj || true
done
sh bmaster.sh uninstall || true
sh bslave.sh uninstall || true
}
case $1 in
install) install_and_start ;;
uninstall) stop_and_uninstall ;;
*) echo Usage: $0 'install|uninstall';;
esac