Merge "Support the use of lists in trigger-build builder."

This commit is contained in:
Jenkins 2015-05-04 16:25:26 +00:00 committed by Gerrit Code Review
commit 3e028f4a5a
3 changed files with 37 additions and 2 deletions

View File

@ -283,7 +283,7 @@ def trigger_builds(parser, xml_parent, data):
Requires the Jenkins :jenkins-wiki:`Parameterized Trigger Plugin
<Parameterized+Trigger+Plugin>`.
:arg str project: the Jenkins project to trigger
:arg list project: the Jenkins project to trigger
:arg str predefined-parameters:
key/value pairs to be passed to the job (optional)
:arg list bool-parameters:
@ -356,6 +356,12 @@ def trigger_builds(parser, xml_parent, data):
Examples:
Basic usage with yaml list of projects.
.. literalinclude::
/../../tests/builders/fixtures/trigger-builds/project-list.yaml
:language: yaml
Basic usage with passing svn revision through.
.. literalinclude:: /../../tests/builders/fixtures/trigger-builds001.yaml
@ -517,7 +523,11 @@ def trigger_builds(parser, xml_parent, data):
'ignore-offline-nodes', True)).lower()
projects = XML.SubElement(tconfig, 'projects')
projects.text = project_def['project']
if isinstance(project_def['project'], list):
projects.text = ",".join(project_def['project'])
else:
projects.text = project_def['project']
condition = XML.SubElement(tconfig, 'condition')
condition.text = 'ALWAYS'
trigger_with_no_params = XML.SubElement(tconfig,

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<builders>
<hudson.plugins.parameterizedtrigger.TriggerBuilder>
<configs>
<hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
<configs>
<hudson.plugins.parameterizedtrigger.CurrentBuildParameters/>
</configs>
<projects>foo,bar,baz</projects>
<condition>ALWAYS</condition>
<triggerWithNoParameters>false</triggerWithNoParameters>
<buildAllNodesWithLabel>false</buildAllNodesWithLabel>
</hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
</configs>
</hudson.plugins.parameterizedtrigger.TriggerBuilder>
</builders>
</project>

View File

@ -0,0 +1,7 @@
builders:
- trigger-builds:
- project:
- "foo"
- "bar"
- "baz"
current-parameters: true