Skip to content
This repository has been archived by the owner on Nov 21, 2018. It is now read-only.

Commit

Permalink
Autoconfig on ec2, start stunnel in script, change to IP addresses in…
Browse files Browse the repository at this point in the history
… stunnel config.
  • Loading branch information
graydon committed Nov 14, 2012
1 parent 1ca08a2 commit e3cfcf0
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
2 changes: 1 addition & 1 deletion rust-buildbot-slave-stunnel.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ pid =
[9987]
client = yes
accept = 127.0.0.1:9987
connect = rust1.vm.labs.scl3.mozilla.com:9988
connect = 10.22.112.51:9988
cafile = ./rust-bot-cert.pem
verify = 3
2 changes: 1 addition & 1 deletion rust-buildbot-win32-slave-stunnel.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[9987]
client = yes
accept = 127.0.0.1:9987
connect = rust1.vm.labs.scl3.mozilla.com:9988
connect = 10.22.112.51:9988
cafile = c:/bot/rust-bot-cert.pem
verify = 3
38 changes: 29 additions & 9 deletions setup-slave.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,41 @@
#!/bin/sh

echo "Enter slave name: "
read SLAVENAME
if [ ! -d slave ]
then
echo "No slave/ dir, setting up..."
if hostname | grep -q '^ip-'
then
echo "Guessing we are on EC2, reading user-data"
read SLAVENAME PASSWORD <<EOF
`curl -s http://169.254.169.254/latest/user-data`
EOF
else
echo "Enter slave name: "
read SLAVENAME
echo "Enter slave password: "
read PASSWORD
fi

echo "Enter slave password: "
read PASSWORD
echo "creating slave: ${SLAVENAME:?}"
buildslave create-slave slave localhost:9987 "${SLAVENAME:?}" "${PASSWORD:?}"
echo "[email protected]" >slave/info/admin
echo $HOSTNAME >slave/info/host
fi

echo "creating slave: $SLAVENAME"
buildslave create-slave slave localhost:9987 "${SLAVENAME}" "${PASSWORD}"
echo "[email protected]" >slave/info/admin
echo $HOSTNAME >slave/info/host
case $MACHTYPE in
*-msys)
# service will start via service console
;;
*)
echo "starting stunnel..."
for s in stunnel4 stunnel
do
if which $s
then
$s rust-buildbot-slave-stunnel.conf || echo "stunnel startup failed, already running?"
fi
done
echo "starting slave..."
(cd slave && buildslave stop; buildslave start)
buildslave restart slave
;;
esac

0 comments on commit e3cfcf0

Please sign in to comment.