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

Commit

Permalink
Get master address from slave userdata
Browse files Browse the repository at this point in the history
Conflicts:
	setup-slave.sh
  • Loading branch information
brson committed May 31, 2014
1 parent 8a20f36 commit fddfb70
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 1 addition & 2 deletions rust-buildbot-slave-stunnel.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ pid =
[9987]
client = yes
accept = 127.0.0.1:9987
connect = 10.22.112.51:9988
cafile = ./rust-bot-cert.pem
verify = 3
verify = 3
11 changes: 9 additions & 2 deletions setup-slave.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

if hostname | grep -q '^ip-'
then
# Some images take time for the user data to appear
sleep 1
echo "Guessing we are on EC2, reading user-data"
read SLAVENAME PASSWORD <<EOF
read SLAVENAME PASSWORD MASTER_ADDY <<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
echo "Enter master address: "
read MASTER_ADDY
fi

rm -f slave/buildbot.tac* slave/twistd.* slave/info/admin slave/info/host
Expand All @@ -19,6 +23,9 @@ buildslave create-slave --force slave localhost:9987 "${SLAVENAME:?}" "${PASSWOR
echo "[email protected]" >slave/info/admin
echo $HOSTNAME >slave/info/host

cp rust-buildbot-slave-stunnel.conf rust-buildbot-slave-stunnel-final.conf
echo "connect = ${MASTER_ADDY:?}" >> rust-buildbot-slave-stunnel-final.conf

case $MACHTYPE in
*-msys)
# service will start via service console
Expand All @@ -29,7 +36,7 @@ case $MACHTYPE in
do
if which $s
then
$s rust-buildbot-slave-stunnel.conf || echo "stunnel startup failed, already running?"
$s rust-buildbot-slave-stunnel-final.conf || echo "stunnel startup failed, already running?"
fi
done
echo "starting slave..."
Expand Down

0 comments on commit fddfb70

Please sign in to comment.