Merge "Description Setter Plugin support as builder"

This commit is contained in:
Jenkins 2016-02-25 18:30:38 +00:00 committed by Gerrit Code Review
commit c5474bfac0
3 changed files with 41 additions and 0 deletions

View File

@ -2905,3 +2905,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']

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<builders>
<hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
<regexp>.*(&lt;a href=.*a&gt;)</regexp>
<description>some description</description>
</hudson.plugins.descriptionsetter.DescriptionSetterBuilder>
</builders>
</project>

View File

@ -0,0 +1,4 @@
builders:
- description-setter:
regexp: ".*(<a href=.*a>)"
description: "some description"