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:
Eren ATAS 2020-07-24 14:35:34 +02:00
parent cf8b2721ed
commit 5768260ecc
3 changed files with 29 additions and 1 deletions

View File

@ -1060,17 +1060,28 @@ def build_name(registry, xml_parent, data):
: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.
: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::
wrappers:
- build-name:
name: Build-${FOO}
description: lorem ipsum dolor
run-at-start: true
run-at-end: false
"""
bsetter = XML.SubElement(
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)

View File

@ -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>

View File

@ -0,0 +1,6 @@
wrappers:
- build-name:
name: Build-${FOO}
description: lorem ipsum dolor
run-at-start: true
run-at-end: false