This repository has been archived by the owner on Nov 21, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get master address from slave userdata
Conflicts: setup-slave.sh
- Loading branch information
Showing
2 changed files
with
10 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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..." | ||
|