Allow 'Build on the same node' in trigger-builds builder
In `trigger-builds` builder, create the '<hudson.plugins.parameterizedtrigger.NodeParameters/>' element if 'same-node' parameter is set to 'true'. This adds the configurability of the 'Build on the same node' parameter. Change-Id: I3b6fa0a50b74932ad9837c7b88835b8b0c9c23ec
This commit is contained in:
parent
1b88a66db2
commit
005d9dc6b0
@ -273,6 +273,8 @@ def trigger_builds(parser, xml_parent, data):
|
||||
to the triggered job
|
||||
:arg bool block: whether to wait for the triggered jobs
|
||||
to finish or not (default false)
|
||||
:arg bool same-node: Use the same node for the triggered builds that was
|
||||
used for this build (optional)
|
||||
|
||||
Example:
|
||||
|
||||
@ -298,6 +300,10 @@ def trigger_builds(parser, xml_parent, data):
|
||||
XML.SubElement(tconfigs,
|
||||
'hudson.plugins.parameterizedtrigger.'
|
||||
'SubversionRevisionBuildParameters')
|
||||
if(project_def.get('same-node')):
|
||||
XML.SubElement(tconfigs,
|
||||
'hudson.plugins.parameterizedtrigger.'
|
||||
'NodeParameters')
|
||||
if 'property-file' in project_def:
|
||||
params = XML.SubElement(tconfigs,
|
||||
'hudson.plugins.parameterizedtrigger.'
|
||||
|
38
tests/builders/fixtures/trigger-builds003.xml
Normal file
38
tests/builders/fixtures/trigger-builds003.xml
Normal file
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<builders>
|
||||
<hudson.plugins.parameterizedtrigger.TriggerBuilder>
|
||||
<configs>
|
||||
<hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
|
||||
<configs>
|
||||
<hudson.plugins.parameterizedtrigger.NodeParameters/>
|
||||
<hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
|
||||
<properties>FOO="bar"</properties>
|
||||
</hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
|
||||
</configs>
|
||||
<projects>build_started</projects>
|
||||
<condition>ALWAYS</condition>
|
||||
<triggerWithNoParameters>false</triggerWithNoParameters>
|
||||
<buildAllNodesWithLabel>false</buildAllNodesWithLabel>
|
||||
<block>
|
||||
<buildStepFailureThreshold>
|
||||
<name>FAILURE</name>
|
||||
<ordinal>2</ordinal>
|
||||
<color>RED</color>
|
||||
</buildStepFailureThreshold>
|
||||
<unstableThreshold>
|
||||
<name>UNSTABLE</name>
|
||||
<ordinal>1</ordinal>
|
||||
<color>YELLOW</color>
|
||||
</unstableThreshold>
|
||||
<failureThreshold>
|
||||
<name>FAILURE</name>
|
||||
<ordinal>2</ordinal>
|
||||
<color>RED</color>
|
||||
</failureThreshold>
|
||||
</block>
|
||||
</hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
|
||||
</configs>
|
||||
</hudson.plugins.parameterizedtrigger.TriggerBuilder>
|
||||
</builders>
|
||||
</project>
|
7
tests/builders/fixtures/trigger-builds003.yaml
Normal file
7
tests/builders/fixtures/trigger-builds003.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
builders:
|
||||
- trigger-builds:
|
||||
- project: "build_started"
|
||||
predefined-parameters:
|
||||
FOO="bar"
|
||||
block: true
|
||||
same-node: true
|
Loading…
Reference in New Issue
Block a user