Merge lp:~frankban/charms/oneiric/buildbot-slave/tests into lp:~yellow/charms/oneiric/buildbot-slave/trunk

Proposed by Francesco Banconi
Status: Merged
Approved by: Graham Binns
Approved revision: 3
Merged at revision: 3
Proposed branch: lp:~frankban/charms/oneiric/buildbot-slave/tests
Merge into: lp:~yellow/charms/oneiric/buildbot-slave/trunk
Diff against target: 62 lines (+30/-5)
3 files modified
hooks/buildbot-relation-changed (+10/-2)
hooks/install (+19/-2)
revision (+1/-1)
To merge this branch: bzr merge lp:~frankban/charms/oneiric/buildbot-slave/tests
Reviewer Review Type Date Requested Status
Graham Binns (community) code Approve
Review via email: mp+90846@code.launchpad.net

Description of the change

Buildslave directory is now created during charm installation (install hook) using localhost.
The tac file is then updated when a buildbot relation is established.

To post a comment you must log in.
Revision history for this message
Graham Binns (gmb) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/buildbot-relation-changed'
2--- hooks/buildbot-relation-changed 2012-01-30 19:09:50 +0000
3+++ hooks/buildbot-relation-changed 2012-01-31 10:31:36 +0000
4@@ -9,9 +9,17 @@
5 PASSWD=`config-get passwd`
6 HOST=`relation-get private-address`
7
8-juju-log "--> create slave"
9+juju-log "--> stop"
10+# The exit code is 0 even if the buildslave was not running.
11+buildslave stop $BUILDBOT_DIR
12+juju-log "<-- stop"
13+
14+juju-log "--> create .tac"
15+if [ -e $BUILDBOT_DIR/buildbot.tac ]; then
16+ rm $BUILDBOT_DIR/buildbot.tac
17+fi
18 buildslave create-slave $BUILDBOT_DIR $HOST $NAME $PASSWD
19-juju-log "<-- create slave"
20+juju-log "<-- create .tac"
21
22 juju-log "--> start"
23 buildslave start $BUILDBOT_DIR
24
25=== modified file 'hooks/install'
26--- hooks/install 2012-01-30 19:09:50 +0000
27+++ hooks/install 2012-01-31 10:31:36 +0000
28@@ -3,8 +3,25 @@
29 # i.e. apt-get install -y foo or bzr branch http://myserver/mycode /srv/webroot
30 set -eux # -x for verbose logging to juju debug-log
31
32-juju-log "--> install"
33+juju-log "--> install packages"
34 BUILDBOT_DIR=`config-get installdir`
35 apt-get install -y buildbot
36 mkdir -p $BUILDBOT_DIR
37-juju-log "<-- install"
38+juju-log "<-- install packages"
39+
40+juju-log "--> create slave"
41+NAME=`config-get name`
42+PASSWD=`config-get passwd`
43+
44+# We set HOST to localhost for now because we can't get the actual host
45+# until we're joined to the buildbot-master instance.
46+HOST="localhost"
47+
48+juju-log "buildslave create-slave $BUILDBOT_DIR $HOST $NAME $PASSWD"
49+buildslave create-slave $BUILDBOT_DIR $HOST $NAME $PASSWD
50+juju-log "<-- create slave"
51+
52+# This is where we would set info/admin and info/host. Not sure what
53+# is pertinent, but the default is a bit lame in the juju case.
54+
55+# This is where we would run something like setuplxc.
56
57=== modified file 'revision'
58--- revision 2012-01-30 19:09:50 +0000
59+++ revision 2012-01-31 10:31:36 +0000
60@@ -1,1 +1,1 @@
61-18
62+19

Subscribers

People subscribed via source and target branches