Add support for Growl plugin
Change-Id: Ifadaf2b33d537a283dc61d5370e3d61a5499682d Signed-off-by: Kien Ha <kienha9922@gmail.com>
This commit is contained in:
parent
03806956ae
commit
e51e64a90c
@ -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.
|
||||
|
9
tests/publishers/fixtures/growl-full.xml
Normal file
9
tests/publishers/fixtures/growl-full.xml
Normal 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>
|
4
tests/publishers/fixtures/growl-full.yaml
Normal file
4
tests/publishers/fixtures/growl-full.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
publishers:
|
||||
- growl:
|
||||
ip: foo.ip.address
|
||||
notify-only-on-fail-or-recovery: true
|
9
tests/publishers/fixtures/growl-minimal.xml
Normal file
9
tests/publishers/fixtures/growl-minimal.xml
Normal 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>
|
3
tests/publishers/fixtures/growl-minimal.yaml
Normal file
3
tests/publishers/fixtures/growl-minimal.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
publishers:
|
||||
- growl:
|
||||
ip: foo.ip.address
|
Loading…
Reference in New Issue
Block a user