Adding ability to use the Build Name Setter Plugin

Change-Id: Icf933a25513f3b349ef67badc7b3e9cd7998089c
Reviewed-on: https://review.openstack.org/15037
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
This commit is contained in:
william.soula 2012-10-29 23:13:43 -05:00 committed by Jenkins
parent 1c6c180945
commit e0692e65ce
2 changed files with 21 additions and 0 deletions

View File

@ -108,6 +108,26 @@ def mask_passwords(parser, xml_parent, data):
'com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper')
def build_name(parser, xml_parent, data):
"""yaml: build-name
Set the name of the build
Requires the Jenkins `Build Name Setter Plugin.
<https://wiki.jenkins-ci.org/display/JENKINS/Build+Name+Setter+Plugin>`_
:arg str name: Name for the build. Typically you would use a variable
from Jenkins in the name. The syntax would be ${FOO} for the FOO variable.
Example::
wrappers:
- build-name:
name: Build-${FOO}
"""
bsetter = XML.SubElement(xml_parent,
'org.jenkinsci.plugins.buildnamesetter.BuildNameSetter')
XML.SubElement(bsetter, 'template').text = data['name']
class Wrappers(jenkins_jobs.modules.base.Base):
sequence = 80

View File

@ -92,6 +92,7 @@ setup(name='jenkins_job_builder',
'timestamps=jenkins_jobs.modules.wrappers:timestamps',
'ansicolor=jenkins_jobs.modules.wrappers:ansicolor',
'mask-passwords=jenkins_jobs.modules.wrappers:mask_passwords',
'build-name=jenkins_jobs.modules.wrappers:build_name',
],
'jenkins_jobs.modules': [
'assignednode=jenkins_jobs.modules.assignednode:AssignedNode',