Add option to block up|down stream builds.

Jenkins has advanced project options that allow you to block if the up
or down stream projects are currently being built. Support these options
through JJB.

Change-Id: I8cfe3e19d1d929517c0a6ee886b31241b3e9b588
Reviewed-on: https://review.openstack.org/16338
Reviewed-by: Antoine Musso <hashar@free.fr>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Paul Belanger <paul.belanger@polybeacon.com>
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Clark Boylan 2012-11-16 13:49:24 -08:00 committed by Jenkins
parent bb507da792
commit 863d0a01d5
2 changed files with 39 additions and 2 deletions

View File

@ -33,6 +33,11 @@ later. There are a few basic optional fields for a Job definition::
name: job-name
project-type: freestyle
defaults: global
disabled: false
concurrent: true
quiet-period: 5
block-downstream: false
block-upstream: false
**project-type**
Defaults to "freestyle", but "maven" can also be specified.
@ -45,6 +50,28 @@ later. There are a few basic optional fields for a Job definition::
should not use the ``global`` defaults, use this field to specify a
different set of defaults.
**disabled**
Boolean value to set whether or not this job should be disabled in
Jenkins. Defaults to ``false`` (job will be enabled).
**concurrent**
Boolean value to set whether or not Jenkins can run this job
concurrently. Defaults to ``false``.
**quiet-period**
Number of seconds to wait between consecutive runs of this job.
Defaults to ``0``.
**block-downstream**
Boolean value to set whether or not this job must block while
downstream jobs are running. Downstream jobs are determined
transitively. Defaults to ``false``.
**block-upstream**
Boolean value to set whether or not this job must block while
upstream jobs are running. Upstream jobs are determined
transitively. Defaults to ``false``.
.. _job-template:
Job Template

View File

@ -179,8 +179,18 @@ class YamlParser(object):
XML.SubElement(xml, 'disabled').text = 'true'
else:
XML.SubElement(xml, 'disabled').text = 'false'
XML.SubElement(xml, 'blockBuildWhenDownstreamBuilding').text = 'false'
XML.SubElement(xml, 'blockBuildWhenUpstreamBuilding').text = 'false'
if data.get('block-downstream'):
XML.SubElement(xml,
'blockBuildWhenDownstreamBuilding').text = 'true'
else:
XML.SubElement(xml,
'blockBuildWhenDownstreamBuilding').text = 'false'
if data.get('block-upstream'):
XML.SubElement(xml,
'blockBuildWhenUpstreamBuilding').text = 'true'
else:
XML.SubElement(xml,
'blockBuildWhenUpstreamBuilding').text = 'false'
if data.get('concurrent'):
XML.SubElement(xml, 'concurrentBuild').text = 'true'
else: