yellow team mailing list archive
-
yellow team
-
Mailing list archive
-
Message #00331
[Merge] lp:~frankban/charms/oneiric/buildbot-slave/tests into lp:~yellow/charms/oneiric/buildbot-slave/trunk
Francesco Banconi has proposed merging lp:~frankban/charms/oneiric/buildbot-slave/tests into lp:~yellow/charms/oneiric/buildbot-slave/trunk.
Requested reviews:
Graham Binns (gmb)
For more details, see:
https://code.launchpad.net/~frankban/charms/oneiric/buildbot-slave/tests/+merge/90846
Buildslave directory is now created during charm installation (install hook) using localhost.
The tac file is then updated when a buildbot relation is established.
--
https://code.launchpad.net/~frankban/charms/oneiric/buildbot-slave/tests/+merge/90846
Your team Launchpad Yellow Squad is subscribed to branch lp:~yellow/charms/oneiric/buildbot-slave/trunk.
=== modified file 'hooks/buildbot-relation-changed'
--- hooks/buildbot-relation-changed 2012-01-30 19:09:50 +0000
+++ hooks/buildbot-relation-changed 2012-01-31 10:31:36 +0000
@@ -9,9 +9,17 @@
PASSWD=`config-get passwd`
HOST=`relation-get private-address`
-juju-log "--> create slave"
+juju-log "--> stop"
+# The exit code is 0 even if the buildslave was not running.
+buildslave stop $BUILDBOT_DIR
+juju-log "<-- stop"
+
+juju-log "--> create .tac"
+if [ -e $BUILDBOT_DIR/buildbot.tac ]; then
+ rm $BUILDBOT_DIR/buildbot.tac
+fi
buildslave create-slave $BUILDBOT_DIR $HOST $NAME $PASSWD
-juju-log "<-- create slave"
+juju-log "<-- create .tac"
juju-log "--> start"
buildslave start $BUILDBOT_DIR
=== modified file 'hooks/install'
--- hooks/install 2012-01-30 19:09:50 +0000
+++ hooks/install 2012-01-31 10:31:36 +0000
@@ -3,8 +3,25 @@
# i.e. apt-get install -y foo or bzr branch http://myserver/mycode /srv/webroot
set -eux # -x for verbose logging to juju debug-log
-juju-log "--> install"
+juju-log "--> install packages"
BUILDBOT_DIR=`config-get installdir`
apt-get install -y buildbot
mkdir -p $BUILDBOT_DIR
-juju-log "<-- install"
+juju-log "<-- install packages"
+
+juju-log "--> create slave"
+NAME=`config-get name`
+PASSWD=`config-get passwd`
+
+# We set HOST to localhost for now because we can't get the actual host
+# until we're joined to the buildbot-master instance.
+HOST="localhost"
+
+juju-log "buildslave create-slave $BUILDBOT_DIR $HOST $NAME $PASSWD"
+buildslave create-slave $BUILDBOT_DIR $HOST $NAME $PASSWD
+juju-log "<-- create slave"
+
+# This is where we would set info/admin and info/host. Not sure what
+# is pertinent, but the default is a bit lame in the juju case.
+
+# This is where we would run something like setuplxc.
=== modified file 'revision'
--- revision 2012-01-30 19:09:50 +0000
+++ revision 2012-01-31 10:31:36 +0000
@@ -1,1 +1,1 @@
-18
+19
Follow ups