Add support for Growl plugin

Change-Id: Ifadaf2b33d537a283dc61d5370e3d61a5499682d
Signed-off-by: Kien Ha <kienha9922@gmail.com>
This commit is contained in:
Kien Ha 2016-08-03 20:36:59 -04:00
parent 03806956ae
commit e51e64a90c
5 changed files with 54 additions and 0 deletions

View File

@ -2161,6 +2161,35 @@ def jira(parser, xml_parent, data):
XML.SubElement(xml_parent, 'hudson.plugins.jira.JiraIssueUpdater')
def growl(parser, xml_parent, data):
"""yaml: growl
Push notifications to growl client.
Requires the Jenkins :jenkins-wiki:`Growl Plugin <Growl+Plugin>`.
:arg str ip: IP address to send growl notifications to (required)
:arg bool notify-only-on-fail-or-recovery: send a growl only when build
fails or recovers from a failure (default false)
Minimal Example:
.. literalinclude:: /../../tests/publishers/fixtures/growl-minimal.yaml
:language: yaml
Full Example:
.. literalinclude:: /../../tests/publishers/fixtures/growl-full.yaml
:language: yaml
"""
growl = XML.SubElement(xml_parent, 'hudson.plugins.growl.GrowlPublisher')
growl.set('plugin', 'growl')
mapping = [
('ip', 'IP', None),
('notify-only-on-fail-or-recovery', 'onlyOnFailureOrRecovery', False),
]
helpers.convert_mapping_to_xml(growl, data, mapping, fail_required=True)
def groovy_postbuild(parser, xml_parent, data):
"""yaml: groovy-postbuild
Execute a groovy script.

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.growl.GrowlPublisher plugin="growl">
<IP>foo.ip.address</IP>
<onlyOnFailureOrRecovery>true</onlyOnFailureOrRecovery>
</hudson.plugins.growl.GrowlPublisher>
</publishers>
</project>

View File

@ -0,0 +1,4 @@
publishers:
- growl:
ip: foo.ip.address
notify-only-on-fail-or-recovery: true

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.growl.GrowlPublisher plugin="growl">
<IP>foo.ip.address</IP>
<onlyOnFailureOrRecovery>false</onlyOnFailureOrRecovery>
</hudson.plugins.growl.GrowlPublisher>
</publishers>
</project>

View File

@ -0,0 +1,3 @@
publishers:
- growl:
ip: foo.ip.address