Merge ~saviq/jenkaas-jobs:drop-prepare-steps into jenkaas-jobs:master
- Git
- lp:~saviq/jenkaas-jobs
- drop-prepare-steps
- Merge into master
Proposed by
Michał Sawicz
Status: | Merged |
---|---|
Merged at revision: | a7f535cf2795bf408dd6799110250e62d81b0872 |
Proposed branch: | ~saviq/jenkaas-jobs:drop-prepare-steps |
Merge into: | jenkaas-jobs:master |
Diff against target: |
571 lines (+71/-207) 13 files modified
dev/null (+0/-67) jenkaas_jobs/yaml/maintain/maintain-8-delete-chroots.sh (+13/-4) jenkaas_jobs/yaml/maintain/maintain-8-delete-chroots.yaml (+0/-2) jenkaas_jobs/yaml/prepare/prepare-0-install.sh (+0/-3) jenkaas_jobs/yaml/prepare/prepare-0-install.yaml (+2/-11) jenkaas_jobs/yaml/prepare/prepare-1-sbuild.sh (+0/-4) jenkaas_jobs/yaml/prepare/prepare-1-sbuild.yaml (+2/-11) jenkaas_jobs/yaml/prepare/prepare-2-chroots.sh (+15/-15) jenkaas_jobs/yaml/prepare/prepare-2-chroots.yaml (+2/-11) tests/fixtures/maintain/maintain-8-delete-chroots.xml (+13/-6) tests/fixtures/prepare/prepare-0-install.xml (+3/-20) tests/fixtures/prepare/prepare-1-sbuild.xml (+3/-21) tests/fixtures/prepare/prepare-2-chroots.xml (+18/-32) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Olivier Tilloy (community) | Approve | ||
Review via email: mp+298750@code.launchpad.net |
Commit message
Description of the change
The run conditions only really made things more confusing. (LP#1566860)
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/jenkaas_jobs/yaml/maintain/maintain-8-delete-chroots.sh b/jenkaas_jobs/yaml/maintain/maintain-8-delete-chroots.sh |
2 | index c510d57..1e6c17f 100644 |
3 | --- a/jenkaas_jobs/yaml/maintain/maintain-8-delete-chroots.sh |
4 | +++ b/jenkaas_jobs/yaml/maintain/maintain-8-delete-chroots.sh |
5 | @@ -3,7 +3,16 @@ |
6 | # log all commands and abort on error |
7 | set -xe |
8 | |
9 | -# delete step, chroot definition and chroot itself |
10 | -sudo rm -Rf steps/2-chroot-v*-$release-$arch \ |
11 | - /etc/schroot/chroot.d/sbuild-$release*-$arch \ |
12 | - /var/lib/schroot/chroots/$release*-$arch |
13 | +# extract target arch |
14 | +TARGET_ARCH=${arch##*-} |
15 | + |
16 | +# non-native architectures have a build arch prefix |
17 | +if [[ ${arch} = cross-* ]]; then |
18 | + NAME="${release}-$(dpkg-architecture -qDEB_BUILD_ARCH)-${TARGET_ARCH}" |
19 | +else |
20 | + NAME="${release}-${TARGET_ARCH}" |
21 | +fi |
22 | + |
23 | +# delete chroot definition and chroot itself |
24 | +sudo rm -Rf /etc/schroot/chroot.d/sbuild-${NAME} \ |
25 | + /var/lib/schroot/chroots/${NAME} |
26 | diff --git a/jenkaas_jobs/yaml/maintain/maintain-8-delete-chroots.yaml b/jenkaas_jobs/yaml/maintain/maintain-8-delete-chroots.yaml |
27 | index 39f867d..ce307b9 100644 |
28 | --- a/jenkaas_jobs/yaml/maintain/maintain-8-delete-chroots.yaml |
29 | +++ b/jenkaas_jobs/yaml/maintain/maintain-8-delete-chroots.yaml |
30 | @@ -2,8 +2,6 @@ |
31 | name: maintain-8-delete-chroots |
32 | project-type: matrix |
33 | description: 'Delete selected chroots.' |
34 | - workspace: ${{JENKINS_HOME}}/prepare |
35 | - child-workspace: . |
36 | node: monitor |
37 | properties: |
38 | - build-discarder: |
39 | diff --git a/jenkaas_jobs/yaml/maintain/maintain-9-reset.yaml b/jenkaas_jobs/yaml/maintain/maintain-9-reset.yaml |
40 | deleted file mode 100644 |
41 | index 65cd45f..0000000 |
42 | --- a/jenkaas_jobs/yaml/maintain/maintain-9-reset.yaml |
43 | +++ /dev/null |
44 | @@ -1,26 +0,0 @@ |
45 | -- job-template: |
46 | - name: maintain-9-reset |
47 | - project-type: matrix |
48 | - description: 'Reset the prepare steps on slaves to force full preparation of a slave.' |
49 | - workspace: ${{JENKINS_HOME}}/prepare |
50 | - child-workspace: . |
51 | - node: monitor |
52 | - properties: |
53 | - - build-discarder: |
54 | - num-to-keep: 10 |
55 | - - rebuild |
56 | - parameters: |
57 | - - matrix-combinations: |
58 | - name: configurations |
59 | - description: 'Which nodes to reset' |
60 | - filter: 'false' |
61 | - axes: |
62 | - - axis: |
63 | - type: slave |
64 | - name: node |
65 | - values: '{obj:build_slaves}' |
66 | - wrappers: |
67 | - - timestamps |
68 | - - workspace-cleanup: |
69 | - include: |
70 | - - steps/* |
71 | diff --git a/jenkaas_jobs/yaml/prepare/prepare-0-install.sh b/jenkaas_jobs/yaml/prepare/prepare-0-install.sh |
72 | index 3fb302a..24a2294 100644 |
73 | --- a/jenkaas_jobs/yaml/prepare/prepare-0-install.sh |
74 | +++ b/jenkaas_jobs/yaml/prepare/prepare-0-install.sh |
75 | @@ -43,6 +43,3 @@ sudo apt-get install --yes \ |
76 | ubuntu-dev-tools \ |
77 | unzip \ |
78 | {install_packages} |
79 | - |
80 | -mkdir -p steps |
81 | -touch steps/0-install-v{job_version} |
82 | diff --git a/jenkaas_jobs/yaml/prepare/prepare-0-install.yaml b/jenkaas_jobs/yaml/prepare/prepare-0-install.yaml |
83 | index 2b88570..9d76273 100644 |
84 | --- a/jenkaas_jobs/yaml/prepare/prepare-0-install.yaml |
85 | +++ b/jenkaas_jobs/yaml/prepare/prepare-0-install.yaml |
86 | @@ -1,14 +1,10 @@ |
87 | - job-template: |
88 | name: prepare-0-install |
89 | install_packages: '' |
90 | - # NOTE: make sure to bump this whenever this job is updated |
91 | - job_version: 11 |
92 | project-type: matrix |
93 | description: | |
94 | This job adds all the needed repositories and installs dependencies needed |
95 | on build slaves. |
96 | - workspace: ${{JENKINS_HOME}}/prepare |
97 | - child-workspace: . |
98 | node: monitor |
99 | properties: |
100 | - build-discarder: |
101 | @@ -25,11 +21,6 @@ |
102 | values: '{obj:build_slaves}' |
103 | wrappers: |
104 | - timestamps |
105 | - - build-name: |
106 | - name: v{job_version} |
107 | builders: |
108 | - - prepare_condition: |
109 | - prepare_step: 0-install-v{job_version} |
110 | - prepare_steps: |
111 | - - shell: |
112 | - !include-raw: prepare-0-install.sh |
113 | + - shell: |
114 | + !include-raw: prepare-0-install.sh |
115 | diff --git a/jenkaas_jobs/yaml/prepare/prepare-1-sbuild.sh b/jenkaas_jobs/yaml/prepare/prepare-1-sbuild.sh |
116 | index 36dc551..2c9bb1c 100644 |
117 | --- a/jenkaas_jobs/yaml/prepare/prepare-1-sbuild.sh |
118 | +++ b/jenkaas_jobs/yaml/prepare/prepare-1-sbuild.sh |
119 | @@ -45,8 +45,4 @@ export PATH="/usr/lib/ccache:$PATH" |
120 | exec "\$@" |
121 | EOF |
122 | sudo chmod +x $ccdir/sbuild-setup |
123 | - |
124 | - # store status |
125 | - mkdir -p steps |
126 | - touch steps/1-sbuild-v{job_version} |
127 | fi |
128 | \ No newline at end of file |
129 | diff --git a/jenkaas_jobs/yaml/prepare/prepare-1-sbuild.yaml b/jenkaas_jobs/yaml/prepare/prepare-1-sbuild.yaml |
130 | index 0dd1e08..5b9bc11 100644 |
131 | --- a/jenkaas_jobs/yaml/prepare/prepare-1-sbuild.yaml |
132 | +++ b/jenkaas_jobs/yaml/prepare/prepare-1-sbuild.yaml |
133 | @@ -1,15 +1,11 @@ |
134 | - job-template: |
135 | name: prepare-1-sbuild |
136 | - # NOTE: make sure to bump this whenever this job is updated |
137 | - job_version: 4 |
138 | project-type: matrix |
139 | description: | |
140 | This job prepares the sbuild environment as required. |
141 | |
142 | NOTE: It might be needed for slaves to be restarted, in which case |
143 | the job will fail and needs to be ran again. |
144 | - workspace: ${{JENKINS_HOME}}/prepare |
145 | - child-workspace: . |
146 | node: monitor |
147 | properties: |
148 | - build-discarder: |
149 | @@ -34,14 +30,9 @@ |
150 | values: '{obj:build_slaves}' |
151 | wrappers: |
152 | - timestamps |
153 | - - build-name: |
154 | - name: v{job_version} |
155 | builders: |
156 | - - prepare_condition: |
157 | - prepare_step: 1-sbuild-v{job_version} |
158 | - prepare_steps: |
159 | - - shell: |
160 | - !include-raw: prepare-1-sbuild.sh |
161 | + - shell: |
162 | + !include-raw: prepare-1-sbuild.sh |
163 | publishers: |
164 | - description_setter: |
165 | set_for_matrix: 'true' |
166 | \ No newline at end of file |
167 | diff --git a/jenkaas_jobs/yaml/prepare/prepare-2-chroots.sh b/jenkaas_jobs/yaml/prepare/prepare-2-chroots.sh |
168 | index 557498c..ce5e080 100644 |
169 | --- a/jenkaas_jobs/yaml/prepare/prepare-2-chroots.sh |
170 | +++ b/jenkaas_jobs/yaml/prepare/prepare-2-chroots.sh |
171 | @@ -6,7 +6,7 @@ set -xe |
172 | # extract target arch |
173 | TARGET_ARCH=${{arch##*-}} |
174 | |
175 | -# users and groups that can access the new chroots |
176 | +# users and groups that can access the chroots |
177 | export SCHROOT_CONF_SUFFIX="source-root-users=root,sbuild |
178 | source-root-groups=root,sbuild |
179 | command-prefix=/var/cache/ccache-sbuild/sbuild-setup" |
180 | @@ -23,21 +23,21 @@ else |
181 | NAME="${{release}}-${{TARGET_ARCH}}" |
182 | fi |
183 | |
184 | -# remove any old matching chroots |
185 | -sudo rm -Rf /etc/schroot/chroot.d/sbuild-${{NAME}} /var/lib/schroot/chroots/${{NAME}} |
186 | +# only proceed if the chroot is not defined already |
187 | +if [ ! -e /etc/schroot/chroot.d/sbuild-${{NAME}} ]; then |
188 | |
189 | -# build the chroot |
190 | -mk-sbuild --name=${{release}} ${{ARGS}} ${{release%%+*}} |
191 | + # remove any stale chroots |
192 | + sudo rm -Rf /var/lib/schroot/chroots/${{NAME}} |
193 | |
194 | -# add the overlay PPA |
195 | -if [[ ${{release}} = *+overlay ]]; then |
196 | - schroot --chroot source:${{NAME}} --user root --directory /root -- \ |
197 | - apt-add-repository --yes --enable-source ppa:ci-train-ppa-service/stable-phone-overlay |
198 | -fi |
199 | + # build the chroot |
200 | + mk-sbuild --name=${{release}} ${{ARGS}} ${{release%%+*}} |
201 | |
202 | -# upgrade packages |
203 | -sbuild-update --update --dist-upgrade --clean --autoclean --autoremove ${{NAME}} |
204 | + # add the overlay PPA |
205 | + if [[ ${{release}} = *+overlay ]]; then |
206 | + schroot --chroot source:${{NAME}} --user root --directory /root -- \ |
207 | + apt-add-repository --yes --enable-source ppa:ci-train-ppa-service/stable-phone-overlay |
208 | + fi |
209 | |
210 | -# store status |
211 | -mkdir -p steps |
212 | -touch steps/2-chroot-v{job_version}-${{release}}-${{arch}} |
213 | \ No newline at end of file |
214 | + # upgrade packages |
215 | + sbuild-update --update --dist-upgrade --clean --autoclean --autoremove ${{NAME}} |
216 | +fi |
217 | \ No newline at end of file |
218 | diff --git a/jenkaas_jobs/yaml/prepare/prepare-2-chroots.yaml b/jenkaas_jobs/yaml/prepare/prepare-2-chroots.yaml |
219 | index eee0604..03bd191 100644 |
220 | --- a/jenkaas_jobs/yaml/prepare/prepare-2-chroots.yaml |
221 | +++ b/jenkaas_jobs/yaml/prepare/prepare-2-chroots.yaml |
222 | @@ -1,11 +1,7 @@ |
223 | - job-template: |
224 | name: prepare-2-chroots |
225 | - # NOTE: make sure to bump this whenever this job is updated |
226 | - job_version: 4 |
227 | project-type: matrix |
228 | description: This job builds a set of chroots for all the supported architectures and releases |
229 | - workspace: ${{JENKINS_HOME}}/prepare |
230 | - child-workspace: . |
231 | node: monitor |
232 | properties: |
233 | - build-discarder: |
234 | @@ -31,11 +27,6 @@ |
235 | values: '{obj:build_slaves}' |
236 | wrappers: |
237 | - timestamps |
238 | - - build-name: |
239 | - name: v{job_version} |
240 | builders: |
241 | - - prepare_condition: |
242 | - prepare_step: 2-chroot-v{job_version}-${{release}}-${{arch}} |
243 | - prepare_steps: |
244 | - - shell: |
245 | - !include-raw: prepare-2-chroots.sh |
246 | \ No newline at end of file |
247 | + - shell: |
248 | + !include-raw: prepare-2-chroots.sh |
249 | \ No newline at end of file |
250 | diff --git a/tests/fixtures/maintain/maintain-8-delete-chroots.xml b/tests/fixtures/maintain/maintain-8-delete-chroots.xml |
251 | index cbafb4f..94bc00f 100644 |
252 | --- a/tests/fixtures/maintain/maintain-8-delete-chroots.xml |
253 | +++ b/tests/fixtures/maintain/maintain-8-delete-chroots.xml |
254 | @@ -34,7 +34,6 @@ |
255 | <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> |
256 | <triggers/> |
257 | <concurrentBuild>false</concurrentBuild> |
258 | - <customWorkspace>${JENKINS_HOME}/prepare</customWorkspace> |
259 | <axes> |
260 | <hudson.matrix.TextAxis> |
261 | <name>release</name> |
262 | @@ -66,10 +65,19 @@ |
263 | # log all commands and abort on error |
264 | set -xe |
265 | |
266 | -# delete step, chroot definition and chroot itself |
267 | -sudo rm -Rf steps/2-chroot-v*-$release-$arch \ |
268 | - /etc/schroot/chroot.d/sbuild-$release*-$arch \ |
269 | - /var/lib/schroot/chroots/$release*-$arch |
270 | +# extract target arch |
271 | +TARGET_ARCH=${arch##*-} |
272 | + |
273 | +# non-native architectures have a build arch prefix |
274 | +if [[ ${arch} = cross-* ]]; then |
275 | + NAME="${release}-$(dpkg-architecture -qDEB_BUILD_ARCH)-${TARGET_ARCH}" |
276 | +else |
277 | + NAME="${release}-${TARGET_ARCH}" |
278 | +fi |
279 | + |
280 | +# delete chroot definition and chroot itself |
281 | +sudo rm -Rf /etc/schroot/chroot.d/sbuild-${NAME} \ |
282 | + /var/lib/schroot/chroots/${NAME} |
283 | </command> |
284 | </hudson.tasks.Shell> |
285 | </builders> |
286 | @@ -80,5 +88,4 @@ sudo rm -Rf steps/2-chroot-v*-$release-$arch \ |
287 | <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> |
288 | <runSequentially>false</runSequentially> |
289 | </executionStrategy> |
290 | - <childCustomWorkspace>.</childCustomWorkspace> |
291 | </matrix-project> |
292 | \ No newline at end of file |
293 | diff --git a/tests/fixtures/maintain/maintain-9-reset.xml b/tests/fixtures/maintain/maintain-9-reset.xml |
294 | deleted file mode 100644 |
295 | index 32f7a22..0000000 |
296 | --- a/tests/fixtures/maintain/maintain-9-reset.xml |
297 | +++ /dev/null |
298 | @@ -1,67 +0,0 @@ |
299 | -<?xml version='1.0' encoding='UTF-8'?> |
300 | -<matrix-project plugin="matrix-project@1.4.1"> |
301 | - <actions/> |
302 | - <description>Reset the prepare steps on slaves to force full preparation of a slave.<!-- Managed by Jenkins Job Builder --></description> |
303 | - <keepDependencies>false</keepDependencies> |
304 | - <properties> |
305 | - <jenkins.model.BuildDiscarderProperty> |
306 | - <strategy> |
307 | - <daysToKeep>-1</daysToKeep> |
308 | - <numToKeep>10</numToKeep> |
309 | - <artifactDaysToKeep>-1</artifactDaysToKeep> |
310 | - <artifactNumToKeep>-1</artifactNumToKeep> |
311 | - </strategy> |
312 | - </jenkins.model.BuildDiscarderProperty> |
313 | - <hudson.model.ParametersDefinitionProperty> |
314 | - <parameterDefinitions> |
315 | - <hudson.plugins.matrix__configuration__parameter.MatrixCombinationsParameterDefinition plugin="matrix-combinations-parameter@1.0.9"> |
316 | - <name>configurations</name> |
317 | - <description>Which nodes to reset</description> |
318 | - <defaultCombinationFilter>false</defaultCombinationFilter> |
319 | - </hudson.plugins.matrix__configuration__parameter.MatrixCombinationsParameterDefinition> |
320 | - </parameterDefinitions> |
321 | - </hudson.model.ParametersDefinitionProperty> |
322 | - <com.sonyericsson.rebuild.RebuildSettings plugin="rebuild@1.25"> |
323 | - <autoRebuild>false</autoRebuild> |
324 | - <rebuildDisabled>false</rebuildDisabled> |
325 | - </com.sonyericsson.rebuild.RebuildSettings> |
326 | - </properties> |
327 | - <customWorkspace>${JENKINS_HOME}/prepare</customWorkspace> |
328 | - <scm class="hudson.scm.NullSCM"/> |
329 | - <assignedNode>monitor</assignedNode> |
330 | - <canRoam>false</canRoam> |
331 | - <disabled>false</disabled> |
332 | - <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> |
333 | - <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> |
334 | - <triggers/> |
335 | - <concurrentBuild>false</concurrentBuild> |
336 | - <axes> |
337 | - <hudson.matrix.LabelAxis> |
338 | - <name>node</name> |
339 | - <values> |
340 | - <string>jenkins-slave-2</string> |
341 | - <string>cyclops-node02</string> |
342 | - </values> |
343 | - </hudson.matrix.LabelAxis> |
344 | - </axes> |
345 | - <builders/> |
346 | - <publishers/> |
347 | - <buildWrappers> |
348 | - <hudson.plugins.timestamper.TimestamperBuildWrapper plugin="timestamper@1.7.2"/> |
349 | - <hudson.plugins.ws__cleanup.PreBuildCleanup plugin="ws-cleanup@0.28"> |
350 | - <patterns> |
351 | - <hudson.plugins.ws__cleanup.Pattern> |
352 | - <pattern>steps/*</pattern> |
353 | - <type>INCLUDE</type> |
354 | - </hudson.plugins.ws__cleanup.Pattern> |
355 | - </patterns> |
356 | - <deleteDirs>false</deleteDirs> |
357 | - <cleanupParameter></cleanupParameter> |
358 | - <externalDelete></externalDelete> |
359 | - </hudson.plugins.ws__cleanup.PreBuildCleanup> |
360 | - </buildWrappers> |
361 | - <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> |
362 | - <runSequentially>false</runSequentially> |
363 | - </executionStrategy> |
364 | - <childCustomWorkspace>.</childCustomWorkspace> |
365 | -</matrix-project> |
366 | diff --git a/tests/fixtures/prepare/prepare-0-install.xml b/tests/fixtures/prepare/prepare-0-install.xml |
367 | index b568ccf..dc191e8 100644 |
368 | --- a/tests/fixtures/prepare/prepare-0-install.xml |
369 | +++ b/tests/fixtures/prepare/prepare-0-install.xml |
370 | @@ -35,7 +35,6 @@ on build slaves. |
371 | <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> |
372 | <triggers/> |
373 | <concurrentBuild>false</concurrentBuild> |
374 | - <customWorkspace>${JENKINS_HOME}/prepare</customWorkspace> |
375 | <axes> |
376 | <hudson.matrix.LabelAxis> |
377 | <name>node</name> |
378 | @@ -46,15 +45,8 @@ on build slaves. |
379 | </hudson.matrix.LabelAxis> |
380 | </axes> |
381 | <builders> |
382 | - <org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder plugin="conditional-buildstep@1.3.3"> |
383 | - <condition class="org.jenkins_ci.plugins.run_condition.logic.Not" plugin="run-condition@1.0"> |
384 | - <condition class="org.jenkins_ci.plugins.run_condition.core.FileExistsCondition"> |
385 | - <file>steps/0-install-v11</file> |
386 | - <baseDir class="org.jenkins_ci.plugins.run_condition.common.BaseDirectory$Workspace"/> |
387 | - </condition> |
388 | - </condition> |
389 | - <buildStep class="hudson.tasks.Shell"> |
390 | - <command>#!/bin/bash |
391 | + <hudson.tasks.Shell> |
392 | + <command>#!/bin/bash |
393 | |
394 | # log all commands and abort on error |
395 | set -ex |
396 | @@ -99,23 +91,14 @@ sudo apt-get install --yes \ |
397 | ubuntu-dev-tools \ |
398 | unzip \ |
399 | additional-package |
400 | - |
401 | -mkdir -p steps |
402 | -touch steps/0-install-v11 |
403 | </command> |
404 | - </buildStep> |
405 | - <runner class="org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail" plugin="run-condition@1.0"/> |
406 | - </org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder> |
407 | + </hudson.tasks.Shell> |
408 | </builders> |
409 | <publishers/> |
410 | <buildWrappers> |
411 | <hudson.plugins.timestamper.TimestamperBuildWrapper plugin="timestamper@1.7.2"/> |
412 | - <org.jenkinsci.plugins.buildnamesetter.BuildNameSetter plugin="build-name-setter@1.3"> |
413 | - <template>v11</template> |
414 | - </org.jenkinsci.plugins.buildnamesetter.BuildNameSetter> |
415 | </buildWrappers> |
416 | <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> |
417 | <runSequentially>false</runSequentially> |
418 | </executionStrategy> |
419 | - <childCustomWorkspace>.</childCustomWorkspace> |
420 | </matrix-project> |
421 | diff --git a/tests/fixtures/prepare/prepare-1-sbuild.xml b/tests/fixtures/prepare/prepare-1-sbuild.xml |
422 | index c1c9133..7b22769 100644 |
423 | --- a/tests/fixtures/prepare/prepare-1-sbuild.xml |
424 | +++ b/tests/fixtures/prepare/prepare-1-sbuild.xml |
425 | @@ -47,7 +47,6 @@ It will be removed from the workspace after consuming. |
426 | <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> |
427 | <triggers/> |
428 | <concurrentBuild>false</concurrentBuild> |
429 | - <customWorkspace>${JENKINS_HOME}/prepare</customWorkspace> |
430 | <axes> |
431 | <hudson.matrix.LabelAxis> |
432 | <name>node</name> |
433 | @@ -58,15 +57,8 @@ It will be removed from the workspace after consuming. |
434 | </hudson.matrix.LabelAxis> |
435 | </axes> |
436 | <builders> |
437 | - <org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder plugin="conditional-buildstep@1.3.3"> |
438 | - <condition class="org.jenkins_ci.plugins.run_condition.logic.Not" plugin="run-condition@1.0"> |
439 | - <condition class="org.jenkins_ci.plugins.run_condition.core.FileExistsCondition"> |
440 | - <file>steps/1-sbuild-v4</file> |
441 | - <baseDir class="org.jenkins_ci.plugins.run_condition.common.BaseDirectory$Workspace"/> |
442 | - </condition> |
443 | - </condition> |
444 | - <buildStep class="hudson.tasks.Shell"> |
445 | - <command>#!/bin/bash |
446 | + <hudson.tasks.Shell> |
447 | + <command>#!/bin/bash |
448 | |
449 | # log all commands and abort on error |
450 | set -ex |
451 | @@ -113,14 +105,8 @@ export PATH="/usr/lib/ccache:$PATH" |
452 | exec "\$@" |
453 | EOF |
454 | sudo chmod +x $ccdir/sbuild-setup |
455 | - |
456 | - # store status |
457 | - mkdir -p steps |
458 | - touch steps/1-sbuild-v4 |
459 | fi</command> |
460 | - </buildStep> |
461 | - <runner class="org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail" plugin="run-condition@1.0"/> |
462 | - </org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder> |
463 | + </hudson.tasks.Shell> |
464 | </builders> |
465 | <publishers> |
466 | <hudson.plugins.descriptionsetter.DescriptionSetterPublisher plugin="description-setter@1.10"> |
467 | @@ -131,12 +117,8 @@ fi</command> |
468 | </publishers> |
469 | <buildWrappers> |
470 | <hudson.plugins.timestamper.TimestamperBuildWrapper plugin="timestamper@1.7.2"/> |
471 | - <org.jenkinsci.plugins.buildnamesetter.BuildNameSetter plugin="build-name-setter@1.3"> |
472 | - <template>v4</template> |
473 | - </org.jenkinsci.plugins.buildnamesetter.BuildNameSetter> |
474 | </buildWrappers> |
475 | <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> |
476 | <runSequentially>false</runSequentially> |
477 | </executionStrategy> |
478 | - <childCustomWorkspace>.</childCustomWorkspace> |
479 | </matrix-project> |
480 | diff --git a/tests/fixtures/prepare/prepare-2-chroots.xml b/tests/fixtures/prepare/prepare-2-chroots.xml |
481 | index 251c922..36ea4fd 100644 |
482 | --- a/tests/fixtures/prepare/prepare-2-chroots.xml |
483 | +++ b/tests/fixtures/prepare/prepare-2-chroots.xml |
484 | @@ -34,7 +34,6 @@ |
485 | <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> |
486 | <triggers/> |
487 | <concurrentBuild>false</concurrentBuild> |
488 | - <customWorkspace>${JENKINS_HOME}/prepare</customWorkspace> |
489 | <axes> |
490 | <hudson.matrix.TextAxis> |
491 | <name>release</name> |
492 | @@ -60,15 +59,8 @@ |
493 | </hudson.matrix.LabelAxis> |
494 | </axes> |
495 | <builders> |
496 | - <org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder plugin="conditional-buildstep@1.3.3"> |
497 | - <condition class="org.jenkins_ci.plugins.run_condition.logic.Not" plugin="run-condition@1.0"> |
498 | - <condition class="org.jenkins_ci.plugins.run_condition.core.FileExistsCondition"> |
499 | - <file>steps/2-chroot-v4-${release}-${arch}</file> |
500 | - <baseDir class="org.jenkins_ci.plugins.run_condition.common.BaseDirectory$Workspace"/> |
501 | - </condition> |
502 | - </condition> |
503 | - <buildStep class="hudson.tasks.Shell"> |
504 | - <command>#!/bin/bash |
505 | + <hudson.tasks.Shell> |
506 | + <command>#!/bin/bash |
507 | |
508 | # log all commands and abort on error |
509 | set -xe |
510 | @@ -76,7 +68,7 @@ set -xe |
511 | # extract target arch |
512 | TARGET_ARCH=${arch##*-} |
513 | |
514 | -# users and groups that can access the new chroots |
515 | +# users and groups that can access the chroots |
516 | export SCHROOT_CONF_SUFFIX="source-root-users=root,sbuild |
517 | source-root-groups=root,sbuild |
518 | command-prefix=/var/cache/ccache-sbuild/sbuild-setup" |
519 | @@ -93,37 +85,31 @@ else |
520 | NAME="${release}-${TARGET_ARCH}" |
521 | fi |
522 | |
523 | -# remove any old matching chroots |
524 | -sudo rm -Rf /etc/schroot/chroot.d/sbuild-${NAME} /var/lib/schroot/chroots/${NAME} |
525 | +# only proceed if the chroot is not defined already |
526 | +if [ ! -e /etc/schroot/chroot.d/sbuild-${NAME} ]; then |
527 | |
528 | -# build the chroot |
529 | -mk-sbuild --name=${release} ${ARGS} ${release%%+*} |
530 | + # remove any stale chroots |
531 | + sudo rm -Rf /var/lib/schroot/chroots/${NAME} |
532 | |
533 | -# add the overlay PPA |
534 | -if [[ ${release} = *+overlay ]]; then |
535 | - schroot --chroot source:${NAME} --user root --directory /root -- \ |
536 | - apt-add-repository --yes --enable-source ppa:ci-train-ppa-service/stable-phone-overlay |
537 | -fi |
538 | + # build the chroot |
539 | + mk-sbuild --name=${release} ${ARGS} ${release%%+*} |
540 | |
541 | -# upgrade packages |
542 | -sbuild-update --update --dist-upgrade --clean --autoclean --autoremove ${NAME} |
543 | + # add the overlay PPA |
544 | + if [[ ${release} = *+overlay ]]; then |
545 | + schroot --chroot source:${NAME} --user root --directory /root -- \ |
546 | + apt-add-repository --yes --enable-source ppa:ci-train-ppa-service/stable-phone-overlay |
547 | + fi |
548 | |
549 | -# store status |
550 | -mkdir -p steps |
551 | -touch steps/2-chroot-v4-${release}-${arch}</command> |
552 | - </buildStep> |
553 | - <runner class="org.jenkins_ci.plugins.run_condition.BuildStepRunner$Run" plugin="run-condition@1.0"/> |
554 | - </org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder> |
555 | + # upgrade packages |
556 | + sbuild-update --update --dist-upgrade --clean --autoclean --autoremove ${NAME} |
557 | +fi</command> |
558 | + </hudson.tasks.Shell> |
559 | </builders> |
560 | <publishers/> |
561 | <buildWrappers> |
562 | <hudson.plugins.timestamper.TimestamperBuildWrapper plugin="timestamper@1.7.2"/> |
563 | - <org.jenkinsci.plugins.buildnamesetter.BuildNameSetter plugin="build-name-setter@1.3"> |
564 | - <template>v4</template> |
565 | - </org.jenkinsci.plugins.buildnamesetter.BuildNameSetter> |
566 | </buildWrappers> |
567 | <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl"> |
568 | <runSequentially>false</runSequentially> |
569 | </executionStrategy> |
570 | - <childCustomWorkspace>.</childCustomWorkspace> |
571 | </matrix-project> |
Looks good to me. Not actually tested but the changes are sound. Only one minor comment inline.