added support for NodeLabel parameter in trigger-builds
Updated trigger-builds to take NodeLabel parameter name and value Updated unit tests Change-Id: I7ea2db6d434bf8224e1e51c27f4b657141bf86f0
This commit is contained in:
parent
d976466c10
commit
e1913ab0cc
@ -298,6 +298,12 @@ def trigger_builds(parser, xml_parent, data):
|
|||||||
:arg bool current-parameters: Whether to include the
|
:arg bool current-parameters: Whether to include the
|
||||||
parameters passed to the current build to the
|
parameters passed to the current build to the
|
||||||
triggered job.
|
triggered job.
|
||||||
|
:arg str node-label-name: Define a name for the NodeLabel parameter to be
|
||||||
|
set. Used in conjunction with node-label. Requires NodeLabel Parameter
|
||||||
|
Plugin (optional)
|
||||||
|
:arg str node-label: Label of the nodes where build should be triggered.
|
||||||
|
Used in conjunction with node-label-name. Requires NodeLabel Parameter
|
||||||
|
Plugin (optional)
|
||||||
:arg bool svn-revision: Whether to pass the svn revision
|
:arg bool svn-revision: Whether to pass the svn revision
|
||||||
to the triggered job
|
to the triggered job
|
||||||
:arg bool git-revision: Whether to pass the git revision
|
:arg bool git-revision: Whether to pass the git revision
|
||||||
@ -432,6 +438,15 @@ def trigger_builds(parser, xml_parent, data):
|
|||||||
XML.SubElement(param, 'value').text = str(
|
XML.SubElement(param, 'value').text = str(
|
||||||
bool_param.get('value', False)).lower()
|
bool_param.get('value', False)).lower()
|
||||||
|
|
||||||
|
if 'node-label-name' in project_def and 'node-label' in project_def:
|
||||||
|
node = XML.SubElement(tconfigs, 'org.jvnet.jenkins.plugins.'
|
||||||
|
'nodelabelparameter.parameterizedtrigger.'
|
||||||
|
'NodeLabelBuildParameter')
|
||||||
|
XML.SubElement(node, 'name').text = \
|
||||||
|
project_def.get('node-label-name')
|
||||||
|
XML.SubElement(node, 'nodeLabel').text = \
|
||||||
|
project_def.get('node-label')
|
||||||
|
|
||||||
if(len(list(tconfigs)) == 0):
|
if(len(list(tconfigs)) == 0):
|
||||||
tconfigs.set('class', 'java.util.Collections$EmptyList')
|
tconfigs.set('class', 'java.util.Collections$EmptyList')
|
||||||
|
|
||||||
|
@ -12,6 +12,10 @@
|
|||||||
<hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
|
<hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
|
||||||
<properties>FOO="bar"</properties>
|
<properties>FOO="bar"</properties>
|
||||||
</hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
|
</hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
|
||||||
|
<org.jvnet.jenkins.plugins.nodelabelparameter.parameterizedtrigger.NodeLabelBuildParameter>
|
||||||
|
<name>NODE</name>
|
||||||
|
<nodeLabel>testnodes</nodeLabel>
|
||||||
|
</org.jvnet.jenkins.plugins.nodelabelparameter.parameterizedtrigger.NodeLabelBuildParameter>
|
||||||
</configs>
|
</configs>
|
||||||
<projects>build_started</projects>
|
<projects>build_started</projects>
|
||||||
<condition>ALWAYS</condition>
|
<condition>ALWAYS</condition>
|
||||||
|
@ -4,5 +4,7 @@ builders:
|
|||||||
predefined-parameters:
|
predefined-parameters:
|
||||||
FOO="bar"
|
FOO="bar"
|
||||||
current-parameters: true
|
current-parameters: true
|
||||||
|
node-label-name: NODE
|
||||||
|
node-label: testnodes
|
||||||
git-revision: true
|
git-revision: true
|
||||||
block: true
|
block: true
|
||||||
|
Loading…
Reference in New Issue
Block a user