ZMQ Event Publisher plugin support added
This is a Jenkins plugin that will publish Jenkins Job run events (start, complete, finish) to a ZMQ PUB socket. Change-Id: Id238033796e6905e18a777fc85c789ff6cf4f59d
This commit is contained in:
parent
6e72dc3781
commit
7d11c704ef
@ -554,6 +554,27 @@ def delivery_pipeline(parser, xml_parent, data):
|
|||||||
XML.SubElement(pipeline, 'taskName').text = data.get('task', '')
|
XML.SubElement(pipeline, 'taskName').text = data.get('task', '')
|
||||||
|
|
||||||
|
|
||||||
|
def zeromq_event(parser, xml_parent, data):
|
||||||
|
"""yaml: zeromq-event
|
||||||
|
This is a Jenkins plugin that will publish Jenkins Job run events
|
||||||
|
(start, complete, finish) to a ZMQ PUB socket.
|
||||||
|
|
||||||
|
Requires the Jenkins `ZMQ Event Publisher.
|
||||||
|
<https://git.openstack.org/cgit/openstack-infra/zmq-event-publisher>`_
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
.. literalinclude:: \
|
||||||
|
/../../tests/properties/fixtures/zeromq-event.yaml
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
zmq_event = XML.SubElement(xml_parent,
|
||||||
|
'org.jenkinsci.plugins.'
|
||||||
|
'ZMQEventPublisher.HudsonNotificationProperty')
|
||||||
|
XML.SubElement(zmq_event, 'enabled').text = 'true'
|
||||||
|
|
||||||
|
|
||||||
class Properties(jenkins_jobs.modules.base.Base):
|
class Properties(jenkins_jobs.modules.base.Base):
|
||||||
sequence = 20
|
sequence = 20
|
||||||
|
|
||||||
|
1
setup.py
1
setup.py
@ -94,6 +94,7 @@ setuptools.setup(
|
|||||||
'priority-sorter=jenkins_jobs.modules.properties:priority_sorter',
|
'priority-sorter=jenkins_jobs.modules.properties:priority_sorter',
|
||||||
'promoted-build=jenkins_jobs.modules.properties:promoted_build',
|
'promoted-build=jenkins_jobs.modules.properties:promoted_build',
|
||||||
'throttle=jenkins_jobs.modules.properties:throttle',
|
'throttle=jenkins_jobs.modules.properties:throttle',
|
||||||
|
'zeromq-event=jenkins_jobs.modules.properties:zeromq_event',
|
||||||
('delivery-pipeline=jenkins_jobs.modules.properties:'
|
('delivery-pipeline=jenkins_jobs.modules.properties:'
|
||||||
'delivery_pipeline'),
|
'delivery_pipeline'),
|
||||||
],
|
],
|
||||||
|
8
tests/properties/fixtures/zeromq-event.xml
Normal file
8
tests/properties/fixtures/zeromq-event.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<project>
|
||||||
|
<properties>
|
||||||
|
<org.jenkinsci.plugins.ZMQEventPublisher.HudsonNotificationProperty>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</org.jenkinsci.plugins.ZMQEventPublisher.HudsonNotificationProperty>
|
||||||
|
</properties>
|
||||||
|
</project>
|
2
tests/properties/fixtures/zeromq-event.yaml
Normal file
2
tests/properties/fixtures/zeromq-event.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
properties:
|
||||||
|
- zeromq-event
|
Loading…
Reference in New Issue
Block a user