Merge "Support the use of lists in trigger-build builder."
This commit is contained in:
commit
3e028f4a5a
@ -283,7 +283,7 @@ def trigger_builds(parser, xml_parent, data):
|
|||||||
Requires the Jenkins :jenkins-wiki:`Parameterized Trigger Plugin
|
Requires the Jenkins :jenkins-wiki:`Parameterized Trigger Plugin
|
||||||
<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:
|
:arg str predefined-parameters:
|
||||||
key/value pairs to be passed to the job (optional)
|
key/value pairs to be passed to the job (optional)
|
||||||
:arg list bool-parameters:
|
:arg list bool-parameters:
|
||||||
@ -356,6 +356,12 @@ def trigger_builds(parser, xml_parent, data):
|
|||||||
|
|
||||||
Examples:
|
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.
|
Basic usage with passing svn revision through.
|
||||||
|
|
||||||
.. literalinclude:: /../../tests/builders/fixtures/trigger-builds001.yaml
|
.. literalinclude:: /../../tests/builders/fixtures/trigger-builds001.yaml
|
||||||
@ -517,7 +523,11 @@ def trigger_builds(parser, xml_parent, data):
|
|||||||
'ignore-offline-nodes', True)).lower()
|
'ignore-offline-nodes', True)).lower()
|
||||||
|
|
||||||
projects = XML.SubElement(tconfig, 'projects')
|
projects = XML.SubElement(tconfig, 'projects')
|
||||||
|
if isinstance(project_def['project'], list):
|
||||||
|
projects.text = ",".join(project_def['project'])
|
||||||
|
else:
|
||||||
projects.text = project_def['project']
|
projects.text = project_def['project']
|
||||||
|
|
||||||
condition = XML.SubElement(tconfig, 'condition')
|
condition = XML.SubElement(tconfig, 'condition')
|
||||||
condition.text = 'ALWAYS'
|
condition.text = 'ALWAYS'
|
||||||
trigger_with_no_params = XML.SubElement(tconfig,
|
trigger_with_no_params = XML.SubElement(tconfig,
|
||||||
|
18
tests/builders/fixtures/trigger-builds/project-list.xml
Normal file
18
tests/builders/fixtures/trigger-builds/project-list.xml
Normal 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>
|
7
tests/builders/fixtures/trigger-builds/project-list.yaml
Normal file
7
tests/builders/fixtures/trigger-builds/project-list.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
builders:
|
||||||
|
- trigger-builds:
|
||||||
|
- project:
|
||||||
|
- "foo"
|
||||||
|
- "bar"
|
||||||
|
- "baz"
|
||||||
|
current-parameters: true
|
Loading…
x
Reference in New Issue
Block a user