5
# Setup connection to master instance once set
6
url=$(relation-get url)
8
if [ "x$url" = "x" ]; then
9
juju-log "Master hasn't exported its url yet, exiting..."
13
# Set the slave hostname to match the juju unit
14
# in the jenkins master instance
15
slavehost=`echo ${JUJU_UNIT_NAME} | sed s,/,-,`
17
juju-log "Configuring jenkins-slave with $url..."
18
sed -i -e "s!^JENKINS_HOSTNAME.*!JENKINS_HOSTNAME=${slavehost}!" \
19
-e "s!^#*JENKINS_URL.*!JENKINS_URL=${url}!" \
20
/etc/default/jenkins-slave
22
juju-log "Restarting jenkins-slave..."
23
# Startup the jenkins-slave service
24
stop jenkins-slave 2>/dev/null || true