summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDawid Malinowski <dawidmalina@gmail.com>2015-07-28 02:59:57 +0200
committerDawid Malinowski <dawidmalina@gmail.com>2015-08-06 18:31:48 +0200
commite757129c7bd4f1f1d703b83d5cd162c048843b40 (patch)
treeeb0cf8b2de5e786245565115cc9123fa25387551
parentf1c34249cc44fef69210b9fbe152086cfbb112d0 (diff)
Add trigger-with-no-params for join-trigger
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: Darragh Bailey <daragh.bailey@gmail.com> Workflow+1: Darragh Bailey <daragh.bailey@gmail.com> Code-Review+2: Joshua Hesketh <joshua.hesketh@rackspace.com> Code-Review+1: Dawid Malinowski <dawidmalina@gmail.com> Submitted-by: Jenkins Submitted-at: Tue, 11 Aug 2015 15:50:57 +0000 Reviewed-on: https://review.openstack.org/206271 Project: openstack-infra/jenkins-job-builder Branch: refs/heads/master
-rw-r--r--jenkins_jobs/modules/publishers.py5
-rw-r--r--tests/publishers/fixtures/join-trigger001.xml2
-rw-r--r--tests/publishers/fixtures/join-trigger001.yaml2
3 files changed, 7 insertions, 2 deletions
diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py
index 2ad4650..49c8830 100644
--- a/jenkins_jobs/modules/publishers.py
+++ b/jenkins_jobs/modules/publishers.py
@@ -263,6 +263,8 @@ def trigger_parameterized_builds(parser, xml_parent, data):
263 :arg str property-file: Use properties from file (optional) 263 :arg str property-file: Use properties from file (optional)
264 :arg bool fail-on-missing: Blocks the triggering of the downstream jobs 264 :arg bool fail-on-missing: Blocks the triggering of the downstream jobs
265 if any of the files are not found in the workspace (default 'False') 265 if any of the files are not found in the workspace (default 'False')
266 :arg bool trigger-with-no-params: Trigger a build even when there are
267 currently no parameters defined (default 'False')
266 :arg str restrict-matrix-project: Filter that restricts the subset 268 :arg str restrict-matrix-project: Filter that restricts the subset
267 of the combinations that the downstream project will run (optional) 269 of the combinations that the downstream project will run (optional)
268 :arg str node-label-name: Specify the Name for the NodeLabel parameter. 270 :arg str node-label-name: Specify the Name for the NodeLabel parameter.
@@ -364,7 +366,8 @@ def trigger_parameterized_builds(parser, xml_parent, data):
364 condition.text = project_def.get('condition', 'ALWAYS') 366 condition.text = project_def.get('condition', 'ALWAYS')
365 trigger_with_no_params = XML.SubElement(tconfig, 367 trigger_with_no_params = XML.SubElement(tconfig,
366 'triggerWithNoParameters') 368 'triggerWithNoParameters')
367 trigger_with_no_params.text = 'false' 369 trigger_with_no_params.text = str(
370 project_def.get('trigger-with-no-params', False)).lower()
368 371
369 372
370def trigger(parser, xml_parent, data): 373def trigger(parser, xml_parent, data):
diff --git a/tests/publishers/fixtures/join-trigger001.xml b/tests/publishers/fixtures/join-trigger001.xml
index 1d81df4..511eb6b 100644
--- a/tests/publishers/fixtures/join-trigger001.xml
+++ b/tests/publishers/fixtures/join-trigger001.xml
@@ -12,7 +12,7 @@
12 </configs> 12 </configs>
13 <projects>archive</projects> 13 <projects>archive</projects>
14 <condition>ALWAYS</condition> 14 <condition>ALWAYS</condition>
15 <triggerWithNoParameters>false</triggerWithNoParameters> 15 <triggerWithNoParameters>true</triggerWithNoParameters>
16 </hudson.plugins.parameterizedtrigger.BuildTriggerConfig> 16 </hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
17 <hudson.plugins.parameterizedtrigger.BuildTriggerConfig> 17 <hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
18 <configs> 18 <configs>
diff --git a/tests/publishers/fixtures/join-trigger001.yaml b/tests/publishers/fixtures/join-trigger001.yaml
index a0bba30..47d96a3 100644
--- a/tests/publishers/fixtures/join-trigger001.yaml
+++ b/tests/publishers/fixtures/join-trigger001.yaml
@@ -8,5 +8,7 @@ publishers:
8 - trigger-parameterized-builds: 8 - trigger-parameterized-builds:
9 - project: archive 9 - project: archive
10 current-parameters: true 10 current-parameters: true
11 trigger-with-no-params: true
11 - project: cleanup 12 - project: cleanup
12 current-parameters: true 13 current-parameters: true
14 trigger-with-no-params: false