From e757129c7bd4f1f1d703b83d5cd162c048843b40 Mon Sep 17 00:00:00 2001 From: Dawid Malinowski Date: Tue, 28 Jul 2015 02:59:57 +0200 Subject: [PATCH] Add trigger-with-no-params for join-trigger Change-Id: I4d4f3b5b4cc22b5f0f26cb6d1f7ee1fb93316e8d --- jenkins_jobs/modules/publishers.py | 5 ++++- tests/publishers/fixtures/join-trigger001.xml | 2 +- tests/publishers/fixtures/join-trigger001.yaml | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py index 2ad46508f..49c883015 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): :arg str property-file: Use properties from file (optional) :arg bool fail-on-missing: Blocks the triggering of the downstream jobs if any of the files are not found in the workspace (default 'False') + :arg bool trigger-with-no-params: Trigger a build even when there are + currently no parameters defined (default 'False') :arg str restrict-matrix-project: Filter that restricts the subset of the combinations that the downstream project will run (optional) :arg str node-label-name: Specify the Name for the NodeLabel parameter. @@ -364,7 +366,8 @@ def trigger_parameterized_builds(parser, xml_parent, data): condition.text = project_def.get('condition', 'ALWAYS') trigger_with_no_params = XML.SubElement(tconfig, 'triggerWithNoParameters') - trigger_with_no_params.text = 'false' + trigger_with_no_params.text = str( + project_def.get('trigger-with-no-params', False)).lower() def trigger(parser, xml_parent, data): diff --git a/tests/publishers/fixtures/join-trigger001.xml b/tests/publishers/fixtures/join-trigger001.xml index 1d81df4ea..511eb6b3b 100644 --- a/tests/publishers/fixtures/join-trigger001.xml +++ b/tests/publishers/fixtures/join-trigger001.xml @@ -12,7 +12,7 @@ archive ALWAYS - false + true diff --git a/tests/publishers/fixtures/join-trigger001.yaml b/tests/publishers/fixtures/join-trigger001.yaml index a0bba303b..47d96a3c0 100644 --- a/tests/publishers/fixtures/join-trigger001.yaml +++ b/tests/publishers/fixtures/join-trigger001.yaml @@ -8,5 +8,7 @@ publishers: - trigger-parameterized-builds: - project: archive current-parameters: true + trigger-with-no-params: true - project: cleanup current-parameters: true + trigger-with-no-params: false