-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup-buildslaves.sh
executable file
·62 lines (54 loc) · 1.54 KB
/
setup-buildslaves.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
#!/bin/bash
set -e
SCRIPT=$(realpath $0)
SCRIPTPATH=$(dirname $SCRIPT)
CFG=$SCRIPTPATH/cfg
LOCAL=$SCRIPTPATH/local
ARCHITECTURES="x64 i686 win32"
ARCHITECTURES="x64"
CONTAINERDIR=$(lxc-config lxc.lxcpath)
if ! [ -n "$CONTAINERDIR" ]; then
echo "CONTAINERDIR not set!"
exit 1
fi
if ! [ -d "$CONTAINERDIR" ]; then
echo "lxc.lxcpath '$CONTAINERDIR' doesn't exist!"
exit 1
fi
for arch in $ARCHITECTURES; do
b=buildslave-$arch
echo $b
CONTAINERROOT=$CONTAINERDIR/$b/rootfs
if ! [ -d "$CONTAINERROOT" ]; then
echo "rootfs '$CONTAINERROOT' doesn't exist!"
exit 1
fi
rsync -av "$CFG"/ "$CONTAINERROOT/"
rsync -av "$LOCAL"/ "$CONTAINERROOT"/
cp "/etc/resolv.conf" "$CONTAINERROOT"/etc/resolv.conf
case $arch in
"i686" | "x64")
lxc-attach --name $b -- /install/install-linux.sh /home/buildbot/lib
lxc-attach --name $b -- /install/make_static_libs.sh /home/buildbot/lib
lxc-attach --name $b -- /install/setup-auth.sh
break
;;
"win32")
lxc-attach --name $b -- /install/install-win32.sh
lxc-attach --name $b -- /install/install-mxe.sh /home/buildbot
lxc-attach --name $b -- /install/setup-auth.sh
break
;;
*)
echo "Unknown arch: $arch"
exit 1
break
;;
esac
lxc-attach --name $b -- apt clean
lxc-attach --name $b -- rm -rf /home/buildbot/lib/tmp /home/buildbot/lib/download /install
lxc-attach --name $b -- systemctl daemon-reload
lxc-attach --name $b -- systemctl start autossh
lxc-attach --name $b -- systemctl start buildbot-worker@spring
lxc-attach --name $b -- chown -R buildbot:buildbot /home/buildbot
done