Merge lp:~javier.collado/ubuntu-test-runlists/jenkins-smoketest-setup-publish-flag into lp:~canonical-ci-engineering/ubuntu-test-runlists/jenkins-smoketest-setup

Proposed by Javier Collado
Status: Merged
Approved by: Javier Collado
Approved revision: 49
Merged at revision: 47
Proposed branch: lp:~javier.collado/ubuntu-test-runlists/jenkins-smoketest-setup-publish-flag
Merge into: lp:~canonical-ci-engineering/ubuntu-test-runlists/jenkins-smoketest-setup
Diff against target: 52 lines (+10/-2)
2 files modified
setup-jobs.py (+8/-2)
templates/base.xml.jinja (+2/-0)
To merge this branch: bzr merge lp:~javier.collado/ubuntu-test-runlists/jenkins-smoketest-setup-publish-flag
Reviewer Review Type Date Requested Status
Javier Collado (community) Approve
Max Brustkern (community) Approve
Review via email: mp+155719@code.launchpad.net

Description of the change

This branch adds a command line flag (publish) that is used to set when to
publish job results.

The default value is false, so the user has to explicitly pass it to set job
configuration to publish. This way a user can verify that the job works fine
and then run the script again with `--publish` to publish future results.

To post a comment you must log in.
Revision history for this message
Max Brustkern (nuclearbob) wrote :

Seems completely straightforward to me. Have you tested it? Do we have a good way to test this on a dummy instance or something? I usually just edit the code to dump the xml, but that's probably not the best way to do it.

review: Approve
Revision history for this message
Javier Collado (javier.collado) wrote :

I've tested it using the staging jenkins instance. Also, I'm using it to test
other changes in the usual instance combined with prefix to avoid overwriting
the real jobs until I'm sure everything works fine. Merging then.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'setup-jobs.py'
2--- setup-jobs.py 2013-03-27 11:08:41 +0000
3+++ setup-jobs.py 2013-03-27 12:27:39 +0000
4@@ -70,6 +70,10 @@
5 help=("Prefix to be used for job names. "
6 "This is useful to test job changes "
7 "without overwriting the configuration."))
8+ parser.add_argument("--publish", action="store_true",
9+ help=("Publish build results. "
10+ "This is useful to test job changes "
11+ "without overwriting the configuration."))
12 return parser
13
14
15@@ -296,7 +300,8 @@
16 scripts_url=scripts_url,
17 command=command,
18 node=args.node,
19- jobtype=jobtype)
20+ jobtype=jobtype,
21+ publish=args.publish)
22 result, text = update_jenkins(instance, args.dryrun, jobname,
23 smokexml)
24 if not result:
25@@ -320,7 +325,8 @@
26 isopath=isopath,
27 jobs=default_jobname,
28 imageurl=args.imageurl,
29- node=args.node)
30+ node=args.node,
31+ publish=args.publish)
32 result, text = update_jenkins(instance, args.dryrun, jobname,
33 defaultxml)
34 if not result:
35
36=== modified file 'templates/base.xml.jinja'
37--- templates/base.xml.jinja 2012-12-13 16:57:59 +0000
38+++ templates/base.xml.jinja 2013-03-27 12:27:39 +0000
39@@ -40,11 +40,13 @@
40 <descriptionForFailed>\1</descriptionForFailed>
41 <setForMatrix>false</setForMatrix>
42 </hudson.plugins.descriptionsetter.DescriptionSetterPublisher>
43+{% if publish %}
44 <hudson.plugins.build__publisher.BuildPublisher>
45 <publishUnstableBuilds>true</publishUnstableBuilds>
46 <publishFailedBuilds>true</publishFailedBuilds>
47 <postActions class="vector"/>
48 </hudson.plugins.build__publisher.BuildPublisher>
49+{% endif %}
50 {% block artifacts %}
51 <hudson.tasks.ArtifactArchiver>
52 <artifacts>**/*</artifacts>

Subscribers

People subscribed via source and target branches

to all changes: