Update Build Name support
Added the missing tags, also added a test case. Change-Id: Ic1cb6c3991afe7ef99dd448e6ba49d510f54bd59 Signed-off-by: Eren ATAS <eatas.contractor@libertyglobal.com>
This commit is contained in:
parent
cf8b2721ed
commit
5768260ecc
|
@ -1060,17 +1060,28 @@ def build_name(registry, xml_parent, data):
|
||||||
:arg str name: Name for the build. Typically you would use a variable
|
:arg str name: Name for the build. Typically you would use a variable
|
||||||
from Jenkins in the name. The syntax would be ${FOO} for
|
from Jenkins in the name. The syntax would be ${FOO} for
|
||||||
the FOO variable.
|
the FOO variable.
|
||||||
|
:arg str description: Build description for the build (Optional).
|
||||||
|
:arg str run-at-start: Set build name before build starts (Optional, default: True).
|
||||||
|
:arg str run-at-end: Set build name after build ends (Optional, default: True).
|
||||||
|
|
||||||
Example::
|
Example::
|
||||||
|
|
||||||
wrappers:
|
wrappers:
|
||||||
- build-name:
|
- build-name:
|
||||||
name: Build-${FOO}
|
name: Build-${FOO}
|
||||||
|
description: lorem ipsum dolor
|
||||||
|
run-at-start: true
|
||||||
|
run-at-end: false
|
||||||
"""
|
"""
|
||||||
bsetter = XML.SubElement(
|
bsetter = XML.SubElement(
|
||||||
xml_parent, "org.jenkinsci.plugins.buildnamesetter." "BuildNameSetter"
|
xml_parent, "org.jenkinsci.plugins.buildnamesetter." "BuildNameSetter"
|
||||||
)
|
)
|
||||||
mapping = [("name", "template", None)]
|
mapping = [
|
||||||
|
("name", "template", None),
|
||||||
|
("description", "descriptionTemplate", ""),
|
||||||
|
("run-at-start", "runAtStart", True),
|
||||||
|
("run-at-end", "runAtEnd", True),
|
||||||
|
]
|
||||||
helpers.convert_mapping_to_xml(bsetter, data, mapping, fail_required=True)
|
helpers.convert_mapping_to_xml(bsetter, data, mapping, fail_required=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<project>
|
||||||
|
<buildWrappers>
|
||||||
|
<org.jenkinsci.plugins.buildnamesetter.BuildNameSetter>
|
||||||
|
<template>Build-${FOO}</template>
|
||||||
|
<descriptionTemplate>lorem ipsum dolor</descriptionTemplate>
|
||||||
|
<runAtStart>true</runAtStart>
|
||||||
|
<runAtEnd>false</runAtEnd>
|
||||||
|
</org.jenkinsci.plugins.buildnamesetter.BuildNameSetter>
|
||||||
|
</buildWrappers>
|
||||||
|
</project>
|
|
@ -0,0 +1,6 @@
|
||||||
|
wrappers:
|
||||||
|
- build-name:
|
||||||
|
name: Build-${FOO}
|
||||||
|
description: lorem ipsum dolor
|
||||||
|
run-at-start: true
|
||||||
|
run-at-end: false
|
Loading…
Reference in New Issue