triggered-builds: Support property file injection
Change-Id: I31091977560eabf5656aaa8706de5410d86d5caf
This commit is contained in:
parent
72c02d4106
commit
a2756a0038
@ -264,6 +264,8 @@ def trigger_builds(parser, xml_parent, data):
|
||||
:arg str project: the Jenkins project to trigger
|
||||
:arg str predefined-parameters:
|
||||
key/value pairs to be passed to the job (optional)
|
||||
:arg str property-file:
|
||||
Pass properties from file to the other job (optional)
|
||||
:arg bool current-parameters: Whether to include the
|
||||
parameters passed to the current build to the
|
||||
triggered job.
|
||||
@ -296,6 +298,14 @@ def trigger_builds(parser, xml_parent, data):
|
||||
XML.SubElement(tconfigs,
|
||||
'hudson.plugins.parameterizedtrigger.'
|
||||
'SubversionRevisionBuildParameters')
|
||||
if 'property-file' in project_def:
|
||||
params = XML.SubElement(tconfigs,
|
||||
'hudson.plugins.parameterizedtrigger.'
|
||||
'FileBuildParameters')
|
||||
propertiesFile = XML.SubElement(params, 'propertiesFile')
|
||||
propertiesFile.text = project_def['property-file']
|
||||
failOnMissing = XML.SubElement(params, 'failTriggerOnMissing')
|
||||
failOnMissing.text = 'true'
|
||||
if 'predefined-parameters' in project_def:
|
||||
params = XML.SubElement(tconfigs,
|
||||
'hudson.plugins.parameterizedtrigger.'
|
||||
|
38
tests/builders/fixtures/trigger-builds002.xml
Normal file
38
tests/builders/fixtures/trigger-builds002.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.FileBuildParameters>
|
||||
<propertiesFile>propfile.txt</propertiesFile>
|
||||
<failTriggerOnMissing>true</failTriggerOnMissing>
|
||||
</hudson.plugins.parameterizedtrigger.FileBuildParameters>
|
||||
</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>
|
5
tests/builders/fixtures/trigger-builds002.yaml
Normal file
5
tests/builders/fixtures/trigger-builds002.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
builders:
|
||||
- trigger-builds:
|
||||
- project: "build_started"
|
||||
property-file: propfile.txt
|
||||
block: true
|
Loading…
Reference in New Issue
Block a user