Description Setter Plugin support as builder
Change-Id: I8be23bd0f8e9f37f55b8da00be818a4949df89cb
This commit is contained in:
parent
bd1c93199a
commit
9a7e6ace38
@ -2873,3 +2873,31 @@ def runscope(parser, xml_parent, data):
|
||||
except KeyError as e:
|
||||
raise MissingAttributeError(e.args[0])
|
||||
XML.SubElement(runscope, 'timeout').text = str(data.get('timeout', '60'))
|
||||
|
||||
|
||||
def description_setter(parser, xml_parent, data):
|
||||
"""yaml: description-setter
|
||||
This plugin sets the description for each build,
|
||||
based upon a RegEx test of the build log file.
|
||||
|
||||
Requires the Jenkins :jenkins-wiki:`Description Setter Plugin
|
||||
<Description+Setter+Plugin>`.
|
||||
|
||||
:arg str regexp: A RegEx which is used to scan the build log file
|
||||
(default '')
|
||||
:arg str description: The description to set on the build (optional)
|
||||
|
||||
Example:
|
||||
|
||||
.. literalinclude::
|
||||
/../../tests/builders/fixtures/description-setter001.yaml
|
||||
:language: yaml
|
||||
"""
|
||||
|
||||
descriptionsetter = XML.SubElement(
|
||||
xml_parent,
|
||||
'hudson.plugins.descriptionsetter.DescriptionSetterBuilder')
|
||||
XML.SubElement(descriptionsetter, 'regexp').text = data.get('regexp', '')
|
||||
if 'description' in data:
|
||||
XML.SubElement(descriptionsetter, 'description').text = data[
|
||||
'description']
|
||||
|
9
tests/builders/fixtures/description-setter001.xml
Normal file
9
tests/builders/fixtures/description-setter001.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<builders>
|
||||
<hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
|
||||
<regexp>.*(<a href=.*a>)</regexp>
|
||||
<description>some description</description>
|
||||
</hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
|
||||
</builders>
|
||||
</project>
|
4
tests/builders/fixtures/description-setter001.yaml
Normal file
4
tests/builders/fixtures/description-setter001.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
builders:
|
||||
- description-setter:
|
||||
regexp: ".*(<a href=.*a>)"
|
||||
description: "some description"
|
Loading…
x
Reference in New Issue
Block a user