Merge "Pass through git revision to triggered jobs"
This commit is contained in:
commit
d976466c10
@ -300,6 +300,8 @@ def trigger_builds(parser, xml_parent, data):
|
||||
triggered job.
|
||||
:arg bool svn-revision: Whether to pass the svn revision
|
||||
to the triggered job
|
||||
:arg bool git-revision: Whether to pass the git revision
|
||||
to the triggered job
|
||||
:arg bool block: whether to wait for the triggered jobs
|
||||
to finish or not (default false)
|
||||
:arg dict block-thresholds: Fail builds and/or mark as failed or unstable
|
||||
@ -353,11 +355,16 @@ def trigger_builds(parser, xml_parent, data):
|
||||
|
||||
Examples:
|
||||
|
||||
Basic usage.
|
||||
Basic usage with passing svn revision through.
|
||||
|
||||
.. literalinclude:: /../../tests/builders/fixtures/trigger-builds001.yaml
|
||||
:language: yaml
|
||||
|
||||
Basic usage with passing git revision through.
|
||||
|
||||
.. literalinclude:: /../../tests/builders/fixtures/trigger-builds006.yaml
|
||||
:language: yaml
|
||||
|
||||
Example with all supported parameter factories.
|
||||
|
||||
.. literalinclude:: \
|
||||
@ -384,6 +391,12 @@ def trigger_builds(parser, xml_parent, data):
|
||||
XML.SubElement(tconfigs,
|
||||
'hudson.plugins.parameterizedtrigger.'
|
||||
'SubversionRevisionBuildParameters')
|
||||
if(project_def.get('git-revision')):
|
||||
params = XML.SubElement(tconfigs,
|
||||
'hudson.plugins.git.'
|
||||
'GitRevisionBuildParameters')
|
||||
combine = XML.SubElement(params, 'combineQueuedCommits')
|
||||
combine.text = 'false'
|
||||
if(project_def.get('same-node')):
|
||||
XML.SubElement(tconfigs,
|
||||
'hudson.plugins.parameterizedtrigger.'
|
||||
|
44
tests/builders/fixtures/trigger-builds006.xml
Normal file
44
tests/builders/fixtures/trigger-builds006.xml
Normal file
@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<builders>
|
||||
<hudson.plugins.parameterizedtrigger.TriggerBuilder>
|
||||
<configs>
|
||||
<hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
|
||||
<configs>
|
||||
<hudson.plugins.parameterizedtrigger.CurrentBuildParameters/>
|
||||
<hudson.plugins.git.GitRevisionBuildParameters>
|
||||
<combineQueuedCommits>false</combineQueuedCommits>
|
||||
</hudson.plugins.git.GitRevisionBuildParameters>
|
||||
<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>
|
||||
<completeBuild>true</completeBuild>
|
||||
</buildStepFailureThreshold>
|
||||
<unstableThreshold>
|
||||
<name>UNSTABLE</name>
|
||||
<ordinal>1</ordinal>
|
||||
<color>YELLOW</color>
|
||||
<completeBuild>true</completeBuild>
|
||||
</unstableThreshold>
|
||||
<failureThreshold>
|
||||
<name>FAILURE</name>
|
||||
<ordinal>2</ordinal>
|
||||
<color>RED</color>
|
||||
<completeBuild>true</completeBuild>
|
||||
</failureThreshold>
|
||||
</block>
|
||||
</hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
|
||||
</configs>
|
||||
</hudson.plugins.parameterizedtrigger.TriggerBuilder>
|
||||
</builders>
|
||||
</project>
|
8
tests/builders/fixtures/trigger-builds006.yaml
Normal file
8
tests/builders/fixtures/trigger-builds006.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
builders:
|
||||
- trigger-builds:
|
||||
- project: "build_started"
|
||||
predefined-parameters:
|
||||
FOO="bar"
|
||||
current-parameters: true
|
||||
git-revision: true
|
||||
block: true
|
Loading…
Reference in New Issue
Block a user