Adding ability to use the Port Allocator Plugin
Change-Id: Ie64b4d3d0b1812347f6cc5921dc1cb5bb22ea27f Reviewed-on: https://review.openstack.org/15402 Approved: James E. Blair <corvus@inaugust.com> Reviewed-by: James E. Blair <corvus@inaugust.com> Tested-by: Jenkins
This commit is contained in:
parent
3cbe673615
commit
88d5d405fd
@ -166,6 +166,28 @@ def build_name(parser, xml_parent, data):
|
||||
XML.SubElement(bsetter, 'template').text = data['name']
|
||||
|
||||
|
||||
def port_allocator(parser, xml_parent, data):
|
||||
"""yaml: port-allocator
|
||||
Assign unique TCP port numbers
|
||||
Requires the Jenkins `Port Allocator Plugin.
|
||||
<https://wiki.jenkins-ci.org/display/JENKINS/Port+Allocator+Plugin>`_
|
||||
|
||||
:arg str name: Variable name of the port or a specific port number
|
||||
|
||||
Example::
|
||||
|
||||
wrappers:
|
||||
- port-allocator:
|
||||
name: SERVER_PORT
|
||||
"""
|
||||
pa = XML.SubElement(xml_parent,
|
||||
'org.jvnet.hudson.plugins.port__allocator.PortAllocator')
|
||||
ports = XML.SubElement(pa, 'ports')
|
||||
dpt = XML.SubElement(ports,
|
||||
'org.jvnet.hudson.plugins.port__allocator.DefaultPortType')
|
||||
XML.SubElement(dpt, 'name').text = data['name']
|
||||
|
||||
|
||||
class Wrappers(jenkins_jobs.modules.base.Base):
|
||||
sequence = 80
|
||||
|
||||
|
1
setup.py
1
setup.py
@ -97,6 +97,7 @@ setup(name='jenkins_job_builder',
|
||||
'build-name=jenkins_jobs.modules.wrappers:build_name',
|
||||
'workspace-cleanup=jenkins_jobs.modules.wrappers:'
|
||||
'workspace_cleanup',
|
||||
'port-allocator=jenkins_jobs.modules.wrappers:port_allocator',
|
||||
],
|
||||
'jenkins_jobs.modules': [
|
||||
'assignednode=jenkins_jobs.modules.assignednode:AssignedNode',
|
||||
|
Loading…
Reference in New Issue
Block a user