Merge lp:~kees/charms/precise/sbuild/trunk into lp:charms/sbuild

Proposed by Kees Cook
Status: Merged
Merged at revision: 4
Proposed branch: lp:~kees/charms/precise/sbuild/trunk
Merge into: lp:charms/sbuild
Diff against target: 235 lines (+71/-42)
12 files modified
README (+6/-6)
config.yaml (+8/-8)
hooks/config-changed (+18/-8)
hooks/install (+16/-16)
hooks/report (+2/-0)
hooks/start (+1/-1)
hooks/stop (+2/-1)
hooks/upgrade-charm (+9/-0)
hooks/wipe (+1/-0)
metadata.yaml (+4/-0)
revision (+1/-1)
slips (+3/-1)
To merge this branch: bzr merge lp:~kees/charms/precise/sbuild/trunk
Reviewer Review Type Date Requested Status
Mark Mims (community) Approve
Review via email: mp+111080@code.launchpad.net

Description of the change

Config updates, maintainer addition.

To post a comment you must log in.
Revision history for this message
Mark Mims (mark-mims) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2011-12-07 17:31:20 +0000
3+++ README 2012-06-19 18:32:20 +0000
4@@ -10,18 +10,18 @@
5
6 For example, to throw a bug-squashing party:
7
8-...configure juju and local.yaml for the password salt, distros, etc...
9+...configure juju and sbuild.yaml for the password salt, distros, etc...
10
11 juju boostrap
12 ...time passes...
13
14-juju deploy --config local.yaml --repository /scratch/ubuntu/vcs/juju/examples local:sbuild builder-debian
15-juju add-unit builder-debian
16-juju add-unit builder-debian
17-juju add-unit builder-debian
18+juju deploy --config sbuild.yaml --repository /scratch/ubuntu/vcs/juju/examples local:sbuild builder-bsp
19+juju add-unit builder-bsp
20+juju add-unit builder-bsp
21+juju add-unit builder-bsp
22 ...
23
24 ...time passes...
25
26 # Dump reports printable on little slips of paper to hand out at the party:
27-./slips | mpage -1 | lp
28+./slips builder-bsp | mpage -1 | lp
29
30=== modified file 'config.yaml'
31--- config.yaml 2011-11-19 22:12:33 +0000
32+++ config.yaml 2012-06-19 18:32:20 +0000
33@@ -8,11 +8,11 @@
34 default: unset
35 description: Salt for generating builder accounts.
36 validator: '.{8,}'
37- distro:
38- type: string
39- default: ubuntu
40- description: Which distribution to create a build environment for.
41- releases:
42- type: string
43- default: precise
44- description: Comma-separated list of releases to create chroots for.
45+ chroots:
46+ type: string
47+ default: ubuntu:quantal
48+ description: Space-separated list of distro:release,release to create chroots for.
49+ packages:
50+ type: string
51+ default: ""
52+ description: Comma-separated list of extra packages to install in chroots.
53
54=== modified file 'hooks/config-changed'
55--- hooks/config-changed 2011-11-19 22:12:33 +0000
56+++ hooks/config-changed 2012-06-19 18:32:20 +0000
57@@ -1,4 +1,5 @@
58 #!/bin/bash
59+set -ex
60
61 USERNAME=$(config-get username)
62 SALT=$(config-get salt)
63@@ -7,8 +8,11 @@
64 juju-log "On $JUJU_UNIT_NAME $USERNAME password is '$password'"
65 echo "$USERNAME:$password" | chpasswd
66
67-DISTRO=$(config-get distro)
68-RELEASES=$(config-get releases)
69+CHROOTS=$(config-get chroots)
70+PACKAGES=$(config-get packages)
71+if [ -n "$PACKAGES" ]; then
72+ PACKAGES="--debootstrap-include=$PACKAGES"
73+fi
74
75 ARCH=$(dpkg-architecture -qDEB_HOST_ARCH)
76 arches=$ARCH
77@@ -16,12 +20,18 @@
78 arches="$arches i386"
79 fi
80 for arch in $arches; do
81- for rel in $(echo $RELEASES | sed -e 's/,/ /g'); do
82- source=$rel-$arch
83- if ! schroot -l | egrep -q "^source:$source$"; then
84- juju-log "Building $DISTRO $rel $arch environment."
85- EDITOR=cat su -c "/usr/bin/mk-sbuild --distro $DISTRO --arch $arch $rel" $USERNAME
86- fi
87+ for item in $CHROOTS; do
88+ distro=$(echo "$item" | cut -d: -f1)
89+ releases=$(echo "$item" | cut -d: -f2)
90+ for rel in $(echo $releases | sed -e 's/,/ /g'); do
91+ source=$rel-$arch
92+ if ! schroot -l | egrep -q "^source:$source$"; then
93+ juju-log "Building $distro $rel $arch environment."
94+ EDITOR=cat su -c "/usr/bin/mk-sbuild --distro $distro --arch $arch $PACKAGES $rel" $USERNAME
95+ fi
96+ done
97 done
98 done
99 perl -pi -e 's/^#source-root-groups=/source-root-groups=/g' /etc/schroot/chroot.d/*
100+
101+exit 0
102
103=== modified file 'hooks/install'
104--- hooks/install 2012-04-16 21:15:04 +0000
105+++ hooks/install 2012-06-19 18:32:20 +0000
106@@ -1,5 +1,5 @@
107 #!/bin/bash
108-set -e
109+set -ex
110
111 USERNAME=$(config-get username)
112 DISTRO=$(config-get distro)
113@@ -46,18 +46,18 @@
114 su -c "sbuild-update --keygen" $USERNAME
115 fi
116
117-ARCH=$(dpkg-architecture -qDEB_HOST_ARCH)
118-arches=$ARCH
119-if [ "$arches" = "amd64" ]; then
120- arches="$arches i386"
121-fi
122-for arch in $arches; do
123- for rel in $(echo $RELEASES | sed -e 's/,/ /g'); do
124- source=$rel-$arch
125- if ! schroot -l | egrep -q "^source:$source$"; then
126- juju-log "Building $DISTRO $rel $arch environment."
127- EDITOR=cat su -c "/usr/bin/mk-sbuild --distro $DISTRO --arch $arch $rel" $USERNAME
128- fi
129- done
130-done
131-perl -pi -e 's/^#source-root-groups=/source-root-groups=/g' /etc/schroot/chroot.d/*
132+rm -f /etc/update-motd.d/98-cloudguest
133+cat >/etc/update-motd.d/98-sbuild <<EOM
134+#!/bin/bash
135+echo ""
136+echo "###################################################################"
137+echo "# Welcome to your own personal 'sbuild' machine. For details see: #"
138+echo "# #"
139+echo "# http://wiki.debian.org/BSP/2011/12/us/Portland/Builders #"
140+echo "# http://wiki.debian.org/mk-sbuild #"
141+echo "# #"
142+echo "###################################################################"
143+EOM
144+chmod a+rx /etc/update-motd.d/98-sbuild
145+
146+exit 0
147
148=== modified file 'hooks/report'
149--- hooks/report 2011-11-19 22:12:33 +0000
150+++ hooks/report 2012-06-19 18:32:20 +0000
151@@ -1,4 +1,6 @@
152 #!/bin/bash
153+set -ex
154+
155 EXTERNAL="$1"
156
157 if [ -n "$JUJU_UNIT_NAME" ]; then
158
159=== modified file 'hooks/start'
160--- hooks/start 2011-11-19 22:12:33 +0000
161+++ hooks/start 2012-06-19 18:32:20 +0000
162@@ -1,3 +1,3 @@
163 #!/bin/bash
164-set -e
165+set -ex
166 exit 0
167
168=== modified file 'hooks/stop'
169--- hooks/stop 2011-11-19 22:12:33 +0000
170+++ hooks/stop 2012-06-19 18:32:20 +0000
171@@ -1,3 +1,4 @@
172 #!/bin/bash
173-set -e
174+set -ex
175 schroot -e --all-sessions
176+exit 0
177
178=== modified symlink 'hooks/upgrade-charm' (properties changed: -x to +x)
179=== target was u'install'
180--- hooks/upgrade-charm 1970-01-01 00:00:00 +0000
181+++ hooks/upgrade-charm 2012-06-19 18:32:20 +0000
182@@ -0,0 +1,9 @@
183+#!/bin/bash
184+set -ex
185+
186+hooks/stop
187+hooks/install
188+hooks/config-changed
189+hooks/start
190+
191+exit 0
192
193=== modified file 'hooks/wipe'
194--- hooks/wipe 2011-11-19 22:12:33 +0000
195+++ hooks/wipe 2012-06-19 18:32:20 +0000
196@@ -1,3 +1,4 @@
197 #!/bin/bash
198+set -ex
199 schroot -e --all-sessions
200 rm -rf /var/lib/schroot/chroots/* /etc/schroot/chroot.d/*
201
202=== modified file 'metadata.yaml'
203--- metadata.yaml 2011-11-19 22:12:33 +0000
204+++ metadata.yaml 2012-06-19 18:32:20 +0000
205@@ -2,3 +2,7 @@
206 summary: "sbuild environment"
207 description: |
208 Installs an sbuild and schroot environment for package building.
209+maintainer: Kees Cook <kees@ubuntu.com>
210+provides:
211+ package-builder:
212+ interface: sbuild
213
214=== modified file 'revision'
215--- revision 2011-11-19 22:12:33 +0000
216+++ revision 2012-06-19 18:32:20 +0000
217@@ -1,1 +1,1 @@
218-17
219+22
220
221=== modified file 'slips' (properties changed: -x to +x)
222--- slips 2011-12-07 17:31:20 +0000
223+++ slips 2012-06-19 18:32:20 +0000
224@@ -2,8 +2,10 @@
225 # Produce per-machine reports to be handed out on slips of paper.
226 set -e
227
228+SERVICE="$1"
229+
230 juju status 2>/dev/null | \
231- egrep 'builder-debian/|public-address' | \
232+ egrep "$SERVICE/|public-address" | \
233 sed '$!N;s/\n/ /;s/://;s/\//-/' | \
234 awk '{print $1 " " $3}' | \
235 while read unit host; do

Subscribers

People subscribed via source and target branches

to all changes: