Added support for least load plugin.

Change-Id: I0c0c9a23e97101f34f144f63e8f9a81f1ac172f9
This commit is contained in:
David Johansen 2014-02-05 02:10:11 +00:00
parent a32288a573
commit 69357d4e30
6 changed files with 43 additions and 0 deletions

View File

@ -145,6 +145,26 @@ def github(parser, xml_parent, data):
github_url.text = data['url']
def least_load(parser, xml_parent, data):
"""yaml: least-load
Enables the Least Load Plugin.
Requires the Jenkins `Least Load Plugin.
<https://wiki.jenkins-ci.org/display/JENKINS/Least+Load+Plugin>`_
:arg bool disabled: whether or not leastload is disabled (default True)
Example::
.. literalinclude:: /../../tests/properties/fixtures/least_load002.yaml
"""
least = XML.SubElement(xml_parent,
'org.bstick12.jenkinsci.plugins.leastload.'
'LeastLoadDisabledProperty')
XML.SubElement(least, 'leastLoadDisabled').text = str(
data.get('disabled', True)).lower()
def throttle(parser, xml_parent, data):
"""yaml: throttle
Throttles the number of builds for this job.

View File

@ -86,6 +86,7 @@ setuptools.setup(
'extended-choice=jenkins_jobs.modules.properties:extended_choice',
'github=jenkins_jobs.modules.properties:github',
'inject=jenkins_jobs.modules.properties:inject',
'least-load=jenkins_jobs.modules.properties:least_load',
'ownership=jenkins_jobs.modules.properties:ownership',
'priority-sorter=jenkins_jobs.modules.properties:priority_sorter',
'promoted-build=jenkins_jobs.modules.properties:promoted_build',

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<properties>
<org.bstick12.jenkinsci.plugins.leastload.LeastLoadDisabledProperty>
<leastLoadDisabled>true</leastLoadDisabled>
</org.bstick12.jenkinsci.plugins.leastload.LeastLoadDisabledProperty>
</properties>
</project>

View File

@ -0,0 +1,3 @@
properties:
- least-load:
disabled: True

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<properties>
<org.bstick12.jenkinsci.plugins.leastload.LeastLoadDisabledProperty>
<leastLoadDisabled>false</leastLoadDisabled>
</org.bstick12.jenkinsci.plugins.leastload.LeastLoadDisabledProperty>
</properties>
</project>

View File

@ -0,0 +1,3 @@
properties:
- least-load:
disabled: False