Add support for Rebuild Plugin

Change-Id: I3b23dbf66d211797af8735f211df9509eac95a3d
This commit is contained in:
Tomas Bezdek 2015-10-15 14:55:51 +01:00
parent 46bc9ecab5
commit 86374bab15
4 changed files with 38 additions and 0 deletions

View File

@ -616,6 +616,30 @@ def zeromq_event(parser, xml_parent, data):
XML.SubElement(zmq_event, 'enabled').text = 'true'
def rebuild(parser, xml_parent, data):
"""yaml: rebuild
Requires the Jenkins :jenkins-wiki:`Rebuild Plugin
<Rebuild+Plugin>`.
:arg bool auto-rebuild: Rebuild without asking for parameters
(default: False)
:arg bool rebuild-disabled: Disable rebuilding for this job
(default: False)
Example:
.. literalinclude:: \
/../../tests/properties/fixtures/rebuild.yaml
"""
sub_element = XML.SubElement(xml_parent,
'com.sonyericsson.rebuild.RebuildSettings')
XML.SubElement(sub_element, 'autoRebuild').text = str(
data.get('auto-rebuild', False)).lower()
XML.SubElement(sub_element, 'rebuildDisabled').text = str(
data.get('rebuild-disabled', False)).lower()
class Properties(jenkins_jobs.modules.base.Base):
sequence = 20

View File

@ -108,6 +108,7 @@ jenkins_jobs.properties =
priority-sorter=jenkins_jobs.modules.properties:priority_sorter
promoted-build=jenkins_jobs.modules.properties:promoted_build
raw=jenkins_jobs.modules.general:raw
rebuild=jenkins_jobs.modules.properties:rebuild
sidebar=jenkins_jobs.modules.properties:sidebar
slave-utilization=jenkins_jobs.modules.properties:slave_utilization
throttle=jenkins_jobs.modules.properties:throttle

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<properties>
<com.sonyericsson.rebuild.RebuildSettings>
<autoRebuild>true</autoRebuild>
<rebuildDisabled>true</rebuildDisabled>
</com.sonyericsson.rebuild.RebuildSettings>
</properties>
</project>

View File

@ -0,0 +1,4 @@
properties:
- rebuild:
auto-rebuild: true
rebuild-disabled: true