Heavy Job Plugin support added
This plugin allows you to define "weight" on each job, and making each job consume that many executors Change-Id: Iee49229b0d3c909f320caa9bd6c1ebb6bc37ddcb
This commit is contained in:
parent
4645ffb7dd
commit
53c41a0e5f
@ -489,6 +489,30 @@ def batch_tasks(parser, xml_parent, data):
|
||||
XML.SubElement(batch_task, 'script').text = task['script']
|
||||
|
||||
|
||||
def heavy_job(parser, xml_parent, data):
|
||||
"""yaml: heavy-job
|
||||
This plugin allows you to define "weight" on each job,
|
||||
and making each job consume that many executors
|
||||
|
||||
Requires the Jenkins `Heavy Job Plugin.
|
||||
<https://wiki.jenkins-ci.org/display/JENKINS/Heavy+Job+Plugin>`_
|
||||
|
||||
:arg int weight: Specify the total number of executors
|
||||
that this job should occupy (defaults to 1)
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
.. literalinclude:: /../../tests/properties/fixtures/heavy-job.yaml
|
||||
|
||||
"""
|
||||
heavyjob = XML.SubElement(xml_parent,
|
||||
'hudson.plugins.'
|
||||
'heavy__job.HeavyJobProperty')
|
||||
XML.SubElement(heavyjob, 'weight').text = str(
|
||||
data.get('weight', 1))
|
||||
|
||||
|
||||
class Properties(jenkins_jobs.modules.base.Base):
|
||||
sequence = 20
|
||||
|
||||
|
1
setup.py
1
setup.py
@ -85,6 +85,7 @@ setuptools.setup(
|
||||
'build-blocker=jenkins_jobs.modules.properties:build_blocker',
|
||||
'extended-choice=jenkins_jobs.modules.properties:extended_choice',
|
||||
'github=jenkins_jobs.modules.properties:github',
|
||||
'heavy-job=jenkins_jobs.modules.properties:heavy_job',
|
||||
'inject=jenkins_jobs.modules.properties:inject',
|
||||
'ownership=jenkins_jobs.modules.properties:ownership',
|
||||
'priority-sorter=jenkins_jobs.modules.properties:priority_sorter',
|
||||
|
8
tests/properties/fixtures/heavy-job.xml
Normal file
8
tests/properties/fixtures/heavy-job.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<properties>
|
||||
<hudson.plugins.heavy__job.HeavyJobProperty>
|
||||
<weight>2</weight>
|
||||
</hudson.plugins.heavy__job.HeavyJobProperty>
|
||||
</properties>
|
||||
</project>
|
3
tests/properties/fixtures/heavy-job.yaml
Normal file
3
tests/properties/fixtures/heavy-job.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
properties:
|
||||
- heavy-job:
|
||||
weight: 2
|
Loading…
Reference in New Issue
Block a user