Merge "Adding publisher support to join-trigger plugin"

This commit is contained in:
Jenkins 2015-07-27 02:05:14 +00:00 committed by Gerrit Code Review
commit f1c34249cc
3 changed files with 42 additions and 1 deletions

View File

@ -2170,7 +2170,11 @@ def join_trigger(parser, xml_parent, data):
"""yaml: join-trigger
Trigger a job after all the immediate downstream jobs have completed
:arg bool even-if-unstable: if true jobs will trigger even if some
downstream jobs are marked as unstable (default false)
:arg list projects: list of projects to trigger
:arg list publishers: list of triggers from publishers module that
defines projects that need to be triggered
Example:
@ -2179,10 +2183,17 @@ def join_trigger(parser, xml_parent, data):
"""
jointrigger = XML.SubElement(xml_parent, 'join.JoinTrigger')
# Simple Project List
joinProjectsText = ','.join(data.get('projects', ['']))
XML.SubElement(jointrigger, 'joinProjects').text = joinProjectsText
publishers = XML.SubElement(jointrigger, 'joinPublishers')
for pub in data.get('publishers', []):
for edited_node in create_publishers(parser, pub):
publishers.append(edited_node)
unstable = str(data.get('even-if-unstable', 'false')).lower()
XML.SubElement(jointrigger, 'evenIfDownstreamUnstable').text = unstable
def jabber(parser, xml_parent, data):
"""yaml: jabber

View File

@ -3,6 +3,29 @@
<publishers>
<join.JoinTrigger>
<joinProjects>project-one,project-two</joinProjects>
<joinPublishers>
<hudson.plugins.parameterizedtrigger.BuildTrigger>
<configs>
<hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
<configs>
<hudson.plugins.parameterizedtrigger.CurrentBuildParameters/>
</configs>
<projects>archive</projects>
<condition>ALWAYS</condition>
<triggerWithNoParameters>false</triggerWithNoParameters>
</hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
<hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
<configs>
<hudson.plugins.parameterizedtrigger.CurrentBuildParameters/>
</configs>
<projects>cleanup</projects>
<condition>ALWAYS</condition>
<triggerWithNoParameters>false</triggerWithNoParameters>
</hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
</configs>
</hudson.plugins.parameterizedtrigger.BuildTrigger>
</joinPublishers>
<evenIfDownstreamUnstable>true</evenIfDownstreamUnstable>
</join.JoinTrigger>
</publishers>
</project>

View File

@ -3,3 +3,10 @@ publishers:
projects:
- project-one
- project-two
even-if-unstable: true
publishers:
- trigger-parameterized-builds:
- project: archive
current-parameters: true
- project: cleanup
current-parameters: true