Merge "Added support for least load plugin."
This commit is contained in:
commit
07fa712f50
@ -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.
|
||||
|
1
setup.py
1
setup.py
@ -87,6 +87,7 @@ setuptools.setup(
|
||||
'github=jenkins_jobs.modules.properties:github',
|
||||
'heavy-job=jenkins_jobs.modules.properties:heavy_job',
|
||||
'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',
|
||||
|
8
tests/properties/fixtures/least-load001.xml
Normal file
8
tests/properties/fixtures/least-load001.xml
Normal 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>
|
3
tests/properties/fixtures/least-load001.yaml
Normal file
3
tests/properties/fixtures/least-load001.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
properties:
|
||||
- least-load:
|
||||
disabled: True
|
8
tests/properties/fixtures/least-load002.xml
Normal file
8
tests/properties/fixtures/least-load002.xml
Normal 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>
|
3
tests/properties/fixtures/least-load002.yaml
Normal file
3
tests/properties/fixtures/least-load002.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
properties:
|
||||
- least-load:
|
||||
disabled: False
|
Loading…
Reference in New Issue
Block a user