Merge lp:~canonical-platform-qa/qa-jenkins-jobs/update-chroot-builder into lp:qa-jenkins-jobs

Proposed by Max Brustkern
Status: Needs review
Proposed branch: lp:~canonical-platform-qa/qa-jenkins-jobs/update-chroot-builder
Merge into: lp:qa-jenkins-jobs
Diff against target: 143 lines (+21/-79)
1 file modified
jobs/mp-ci-autoland/ci-jobs.yaml (+21/-79)
To merge this branch: bzr merge lp:~canonical-platform-qa/qa-jenkins-jobs/update-chroot-builder
Reviewer Review Type Date Requested Status
platform-qa-bot continuous-integration Approve
Canonical Platform QA Jenkins Pending
Review via email: mp+318281@code.launchpad.net

Commit message

Update pbuilder chroot creation and make it idempotent

Description of the change

These changes update the pbuilder chroot setup with new requirements and make it one idempotent job.

To post a comment you must log in.
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)

Unmerged revisions

220. By Max Brustkern

Updated pbuilder chroot setup to be idempotent job that fits new requirements

219. By Max Brustkern

Add daily spread tests for ubuntu core.

Approved by platform-qa-bot, Jean-Baptiste Lallement.

218. By Sergio Cazzolato

adding aggregation to the performance tests execution.

Approved by platform-qa-bot.

217. By Max Brustkern

Updating exit status

216. By Max Brustkern

Removing old hooks

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'jobs/mp-ci-autoland/ci-jobs.yaml'
2--- jobs/mp-ci-autoland/ci-jobs.yaml 2017-02-24 16:37:18 +0000
3+++ jobs/mp-ci-autoland/ci-jobs.yaml 2017-02-24 20:24:18 +0000
4@@ -21,16 +21,9 @@
5 # should be tested there as well, as noted below.
6
7 - builder:
8- name: create-chroot
9- # This and the update-chroot builder share a lot of code. TODO: Dedupe/be
10- # smarter about this.
11+ name: setup-chroot
12 builders:
13 - shell: |
14- # TODO: Use the production PPA
15- sudo add-apt-repository -y ppa:jenkaas-hackers/tools
16- sudo apt-get update
17- sudo apt-get install -y --assume-yes sphinx-common python3-setuptools pbuilder pbuilderjenkins bzr-builddeb devscripts dh-translations
18-
19 # Only proceed if the config options are set for building chroots
20 if [ -z "$distributions" ] || [ -z "$arches" ]; then
21 echo "Missing vales for distributions and arches,"
22@@ -40,65 +33,27 @@
23
24 COMPONENTS="main restricted universe multiverse"
25 MIRROR="http://archive.ubuntu.com/ubuntu/"
26- EXTRA_PACKAGES="apt-transport-https ca-certificates devscripts eatmydata gnupg patchutils pbuilder vim-tiny"
27+ EXTRA_PACKAGES="apt-transport-https bzr ca-certificates devscripts eatmydata gnupg patchutils pbuilder vim-tiny"
28 for dist in $distributions; do
29 for arch in $arches; do
30+ OTHER_MIRROR="deb $MIRROR $dist-updates main restricted universe multiverse|deb-src $MIRROR $dist-updates main restricted universe multiverse|deb-src $MIRROR $dist main restricted universe multiverse"
31+ TARBALL="/var/cache/pbuilder/$dist-$arch.tgz"
32 if [ ! -f "/var/cache/pbuilder/$dist-$arch.tgz" ]; then
33- OTHER_MIRROR="deb $MIRROR $dist-updates main restricted universe multiverse|deb-src $MIRROR $dist-updates main restricted universe multiverse|deb-src $MIRROR $dist main restricted universe multiverse"
34 sudo /usr/sbin/pbuilder --create \
35 --distribution "$dist" \
36 --architecture "$arch" \
37- --basetgz "/var/cache/pbuilder/$dist-$arch.tgz" \
38+ --basetgz "$TARBALL" \
39 --debootstrapopts \
40 --variant=buildd
41- sudo /usr/sbin/pbuilder --update \
42- --distribution "$dist" \
43- --basetgz "/var/cache/pbuilder/$dist-$arch.tgz" \
44- --components "$COMPONENTS" \
45- --mirror "$MIRROR" \
46- --othermirror "$OTHER_MIRROR" \
47- --override-config \
48- --extrapackages "$EXTRA_PACKAGES"
49- else
50- echo "Skipping creation of /var/cache/pbuilder/$dist-$arch.tgz, it already exists."
51- fi
52- done
53- done
54-
55-
56-- builder:
57- name: update-chroot
58- builders:
59- - shell: |
60- # Only proceed if the config options are set for building chroots
61- if [ -z "$distributions" ] || [ -z "$arches" ]; then
62- echo "Missing values for distributions and arches,"
63- echo " skipping pbuilder chroot creation."
64- exit 1
65- fi
66-
67- COMPONENTS="main restricted universe multiverse"
68- MIRROR="http://archive.ubuntu.com/ubuntu/"
69-
70- for dist in "$distributions"; do
71- for arch in "$arches"; do
72- if [ -f "/var/cache/pbuilder/$dist-$arch.tgz" ]; then
73- OTHER_MIRROR="deb $MIRROR $dist-updates $COMPONENTS|deb-src $MIRROR $dist-updates $COMPONENTS|deb-src $MIRROR $dist $COMPONENTS"
74- sudo /usr/sbin/pbuilder --update \
75- --basetgz "/var/cache/pbuilder/$dist-$arch.tgz" \
76- --distribution "$dist" \
77- --components "$COMPONENTS" \
78- --mirror "$MIRROR" \
79- --othermirror "$OTHER_MIRROR" \
80- --override-config
81- if [ -n "$extra_packages" ]; then
82- sudo /usr/sbin/pbuilder --update \
83- --basetgz "/var/cache/pbuilder/$dist-$arch.tgz" \
84- --extrapackages "$extra_packages"
85- fi
86- else
87- echo "Chroot /var/cache/pbuilder/$dist-$arch.tgz not found, skipping update."
88- fi
89+ fi
90+ sudo /usr/sbin/pbuilder --update \
91+ --distribution "$dist" \
92+ --basetgz "$TARBALL" \
93+ --components "$COMPONENTS" \
94+ --mirror "$MIRROR" \
95+ --othermirror "$OTHER_MIRROR" \
96+ --override-config \
97+ --extrapackages "$EXTRA_PACKAGES"
98 done
99 done
100
101@@ -281,9 +236,9 @@
102 description: The merge proposal to process
103
104 - job-template:
105- name: 'create-debian-chroot'
106+ name: 'setup-debian-chroot'
107 description: |
108- Create the required chroots for pbuilder.
109+ Create or update the required chroots for pbuilder.
110 node: 'jenkins-slave-2'
111 parameters:
112 - string:
113@@ -296,25 +251,12 @@
114 description: 'Distributions to create machines of'
115 builders:
116 - clear-artifacts
117- - create-chroot
118+ - shell: |
119+ sudo add-apt-repository -y ppa:jenkaas-hackers/tools
120+ sudo apt-get update
121+ sudo apt-get install -y --assume-yes sphinx-common python3-setuptools pbuilder pbuilderjenkins bzr-builddeb devscripts dh-translations
122
123-- job-template:
124- name: 'update-debian-chroot'
125- description: |
126- Update the required chroots for pbuilder.
127- node: 'jenkins-slave-2'
128- parameters:
129- - string:
130- name: arches
131- default: 'amd64 i386'
132- description: 'Architectures to create machines of'
133- - string:
134- name: distributions
135- default: 'xenial'
136- description: 'Distributions to create machines of'
137- builders:
138- - clear-artifacts
139- - update-chroot
140+ - setup-chroot
141
142 - job-template:
143 name: 'build-{dist}-{arch}-package'

Subscribers

People subscribed via source and target branches