Merge "Add parameter to trigger_parameterized_builds"

This commit is contained in:
Jenkins 2014-12-01 23:27:21 +00:00 committed by Gerrit Code Review
commit ff7b93c8ef
3 changed files with 23 additions and 1 deletions

View File

@ -168,6 +168,8 @@ def trigger_parameterized_builds(parser, xml_parent, data):
Use of the `node-label-name` or `node-label` parameters
requires the Jenkins `NodeLabel Parameter Plugin.
Note: 'node-parameters' overrides the Node that the triggered
project is tied to.
<https://wiki.jenkins-ci.org/display/JENKINS/NodeLabel+Parameter+P
lugin>`_
@ -176,6 +178,8 @@ def trigger_parameterized_builds(parser, xml_parent, data):
job (optional)
:arg bool current-parameters: Whether to include the parameters passed
to the current build to the triggered job (optional)
:arg bool node-parameters: Use the same Node for the triggered builds
that was used for this build. (optional)
:arg bool svn-revision: Pass svn revision to the triggered job (optional)
:arg bool git-revision: Pass git revision to the other job (optional)
:arg str condition: when to trigger the other job (default 'ALWAYS')
@ -208,6 +212,7 @@ def trigger_parameterized_builds(parser, xml_parent, data):
or 'git-revision' in project_def
or 'property-file' in project_def
or 'current-parameters' in project_def
or 'node-parameters' in project_def
or 'svn-revision' in project_def
or 'restrict-matrix-project' in project_def
or 'node-label-name' in project_def
@ -240,6 +245,11 @@ def trigger_parameterized_builds(parser, xml_parent, data):
XML.SubElement(tconfigs,
'hudson.plugins.parameterizedtrigger.'
'CurrentBuildParameters')
if ('node-parameters' in project_def
and project_def['node-parameters']):
XML.SubElement(tconfigs,
'hudson.plugins.parameterizedtrigger.'
'NodeParameters')
if 'svn-revision' in project_def and project_def['svn-revision']:
XML.SubElement(tconfigs,
'hudson.plugins.parameterizedtrigger.'

View File

@ -65,6 +65,15 @@
<condition>ALWAYS</condition>
<triggerWithNoParameters>false</triggerWithNoParameters>
</hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
<hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
<configs>
<hudson.plugins.parameterizedtrigger.CurrentBuildParameters/>
<hudson.plugins.parameterizedtrigger.NodeParameters/>
</configs>
<projects>test-project-same-node</projects>
<condition>ALWAYS</condition>
<triggerWithNoParameters>false</triggerWithNoParameters>
</hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
</configs>
</hudson.plugins.parameterizedtrigger.BuildTrigger>
</publishers>

View File

@ -13,4 +13,7 @@ publishers:
- project: yet_another_job_2
node-label-name: foo
- project: yet_another_job_3
node-label: node-label-foo || node-label-bar
node-label: node-label-foo || node-label-bar
- project: 'test-project-same-node'
node-parameters: true
current-parameters: true