Add support for jms_messaging builder and publisher
- Added the following for builder and publisher - Added all the fields for JMS Messaging plugins - Added a minimal example - Added a full example - Added info in trigger for builder description of the plugin Change-Id: Ifa209978dd38692da9f9d06bdf34782bd684a324
This commit is contained in:
parent
3c902a5d38
commit
1979a954d1
jenkins_jobs/modules
tests
@ -3254,6 +3254,50 @@ def cloudformation(registry, xml_parent, data):
|
||||
region_dict)
|
||||
|
||||
|
||||
def jms_messaging(registry, xml_parent, data):
|
||||
"""yaml: jms-messaging
|
||||
The JMS Messaging Plugin provides the following functionality:
|
||||
- A build trigger to submit jenkins jobs upon receipt
|
||||
of a matching message.
|
||||
- A builder that may be used to submit a message to the topic
|
||||
upon the completion of a job
|
||||
- A post-build action that may be used to submit a message to the topic
|
||||
upon the completion of a job
|
||||
|
||||
|
||||
JMS Messaging provider types supported:
|
||||
- ActiveMQ
|
||||
- FedMsg
|
||||
|
||||
Requires the Jenkins :jenkins-wiki:`JMS Messaging Plugin
|
||||
Pipeline Plugin <JMS+Messaging+Plugin>`.
|
||||
|
||||
:arg str override-topic: If you need to override the default topic.
|
||||
(default '')
|
||||
:arg str provider-name: Name of message provider setup in the
|
||||
global config. (default '')
|
||||
:arg str msg-type: A message type
|
||||
(default 'CodeQualityChecksDone')
|
||||
:arg str msg-props: Message header to publish. (default '')
|
||||
:arg str msg-content: Message body to publish. (default '')
|
||||
|
||||
|
||||
Full Example:
|
||||
|
||||
.. literalinclude::
|
||||
../../tests/builders/fixtures/jms-messaging-full.yaml
|
||||
:language: yaml
|
||||
|
||||
Minimal Example:
|
||||
|
||||
.. literalinclude::
|
||||
../../tests/builders/fixtures/jms-messaging-minimal.yaml
|
||||
:language: yaml
|
||||
"""
|
||||
helpers.jms_messaging_common(xml_parent, 'com.redhat.jenkins.plugins.ci.'
|
||||
'CIMessageBuilder', data)
|
||||
|
||||
|
||||
def openshift_build_verify(registry, xml_parent, data):
|
||||
"""yaml: openshift-build-verify
|
||||
Performs the equivalent of an 'oc get builds` command invocation for the
|
||||
|
@ -522,3 +522,29 @@ def convert_mapping_to_xml(parent, data, mapping, fail_required=False):
|
||||
XML.SubElement(parent, xmlname).text = str(valid_dict[val])
|
||||
else:
|
||||
XML.SubElement(parent, xmlname).text = str(val)
|
||||
|
||||
|
||||
def jms_messaging_common(parent, subelement, data):
|
||||
"""JMS common helper function
|
||||
|
||||
Pass the XML parent and the specific subelement from the builder or the
|
||||
publisher.
|
||||
|
||||
data is passed to mapper helper function to map yaml fields to XML fields
|
||||
"""
|
||||
namespace = XML.SubElement(parent,
|
||||
subelement)
|
||||
|
||||
if 'override-topic' in data:
|
||||
overrides = XML.SubElement(namespace, 'overrides')
|
||||
XML.SubElement(overrides,
|
||||
'topic').text = str(data.get('override-topic', ''))
|
||||
|
||||
mapping = [
|
||||
# option, xml name, default value
|
||||
("provider-name", 'providerName', ''),
|
||||
("msg-type", 'messageType', 'CodeQualityChecksDone'),
|
||||
("msg-props", 'messageProperties', ''),
|
||||
("msg-content", 'messageContent', ''),
|
||||
]
|
||||
convert_mapping_to_xml(namespace, data, mapping, fail_required=True)
|
||||
|
@ -6652,6 +6652,50 @@ def phabricator(registry, xml_parent, data):
|
||||
data.get('comment-with-console-link-on-failure')).lower()
|
||||
|
||||
|
||||
def jms_messaging(registry, xml_parent, data):
|
||||
"""yaml: jms-messaging
|
||||
The JMS Messaging Plugin provides the following functionality:
|
||||
- A build trigger to submit jenkins jobs upon receipt
|
||||
of a matching message.
|
||||
- A builder that may be used to submit a message to the topic
|
||||
upon the completion of a job
|
||||
- A post-build action that may be used to submit a message to the topic
|
||||
upon the completion of a job
|
||||
|
||||
|
||||
JMS Messaging provider types supported:
|
||||
- ActiveMQ
|
||||
- FedMsg
|
||||
|
||||
Requires the Jenkins :jenkins-wiki:`JMS Messaging Plugin
|
||||
Pipeline Plugin <JMS+Messaging+Plugin>`.
|
||||
|
||||
:arg str override-topic: If you need to override the default topic.
|
||||
(default '')
|
||||
:arg str provider-name: Name of message provider setup in the
|
||||
global config. (default '')
|
||||
:arg str msg-type: A message type
|
||||
(default 'CodeQualityChecksDone')
|
||||
:arg str msg-props: Message header to publish. (default '')
|
||||
:arg str msg-content: Message body to publish. (default '')
|
||||
|
||||
|
||||
Full Example:
|
||||
|
||||
.. literalinclude::
|
||||
../../tests/publishers/fixtures/jms-messaging-full.yaml
|
||||
:language: yaml
|
||||
|
||||
Minimal Example:
|
||||
|
||||
.. literalinclude::
|
||||
../../tests/publishers/fixtures/jms-messaging-minimal.yaml
|
||||
:language: yaml
|
||||
"""
|
||||
helpers.jms_messaging_common(xml_parent, 'com.redhat.jenkins.plugins.ci.'
|
||||
'CIMessageNotifier', data)
|
||||
|
||||
|
||||
def openshift_build_canceller(registry, xml_parent, data):
|
||||
"""yaml: openshift-build-canceller
|
||||
This action is intended to provide cleanup for a Jenkins job which failed
|
||||
|
@ -782,6 +782,8 @@ def jms_messaging(registry, xml_parent, data):
|
||||
The JMS Messaging Plugin provides the following functionality:
|
||||
- A build trigger to submit jenkins jobs upon receipt
|
||||
of a matching message.
|
||||
- A builder that may be used to submit a message to the topic
|
||||
upon the completion of a job
|
||||
- A post-build action that may be used to submit a message to the topic
|
||||
upon the completion of a job
|
||||
|
||||
|
26
tests/builders/fixtures/jms-messaging-full.xml
Normal file
26
tests/builders/fixtures/jms-messaging-full.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<builders>
|
||||
<com.redhat.jenkins.plugins.ci.CIMessageBuilder>
|
||||
<overrides>
|
||||
<topic>org.centos.stage.ci.pipeline.compose.complete</topic>
|
||||
</overrides>
|
||||
<providerName>fedmsg</providerName>
|
||||
<messageType>Custom</messageType>
|
||||
<messageProperties>topic=org.centos.prod.ci.pipeline.compose.complete
|
||||
username=fedora-atomic
|
||||
</messageProperties>
|
||||
<messageContent>{
|
||||
"build_url": "${BUILD_URL}",
|
||||
"compose_url": "<full-url-to-compose>",
|
||||
"build_id": "${BUILD_ID}",
|
||||
"ref": "fedora/rawhide/${basearch}/atomic-host",
|
||||
"rev": "<sha of the commit from dist-git>",
|
||||
"namespace": "rpms",
|
||||
"repo": "php-simplepie",
|
||||
"status": "<success/failure/aborted>",
|
||||
"test_guidance": "<comma-separated-list-of-test-suites-to-run>"}
|
||||
}</messageContent>
|
||||
</com.redhat.jenkins.plugins.ci.CIMessageBuilder>
|
||||
</builders>
|
||||
</project>
|
20
tests/builders/fixtures/jms-messaging-full.yaml
Normal file
20
tests/builders/fixtures/jms-messaging-full.yaml
Normal file
@ -0,0 +1,20 @@
|
||||
builders:
|
||||
- jms-messaging:
|
||||
override-topic: org.centos.stage.ci.pipeline.compose.complete
|
||||
provider-name: fedmsg
|
||||
msg-type: Custom
|
||||
msg-props: |
|
||||
topic=org.centos.prod.ci.pipeline.compose.complete
|
||||
username=fedora-atomic
|
||||
msg-content: |
|
||||
{
|
||||
"build_url": "${BUILD_URL}",
|
||||
"compose_url": "<full-url-to-compose>",
|
||||
"build_id": "${BUILD_ID}",
|
||||
"ref": "fedora/rawhide/${basearch}/atomic-host",
|
||||
"rev": "<sha of the commit from dist-git>",
|
||||
"namespace": "rpms",
|
||||
"repo": "php-simplepie",
|
||||
"status": "<success/failure/aborted>",
|
||||
"test_guidance": "<comma-separated-list-of-test-suites-to-run>"}
|
||||
}
|
11
tests/builders/fixtures/jms-messaging-minimal.xml
Normal file
11
tests/builders/fixtures/jms-messaging-minimal.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<builders>
|
||||
<com.redhat.jenkins.plugins.ci.CIMessageBuilder>
|
||||
<providerName>fedmsg</providerName>
|
||||
<messageType>CodeQualityChecksDone</messageType>
|
||||
<messageProperties>test</messageProperties>
|
||||
<messageContent>test</messageContent>
|
||||
</com.redhat.jenkins.plugins.ci.CIMessageBuilder>
|
||||
</builders>
|
||||
</project>
|
6
tests/builders/fixtures/jms-messaging-minimal.yaml
Normal file
6
tests/builders/fixtures/jms-messaging-minimal.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
builders:
|
||||
- jms-messaging:
|
||||
provider-name: fedmsg
|
||||
msg-type: CodeQualityChecksDone
|
||||
msg-props: test
|
||||
msg-content: test
|
26
tests/publishers/fixtures/jms-messaging-full.xml
Normal file
26
tests/publishers/fixtures/jms-messaging-full.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<publishers>
|
||||
<com.redhat.jenkins.plugins.ci.CIMessageNotifier>
|
||||
<overrides>
|
||||
<topic>org.centos.stage.ci.pipeline.compose.complete</topic>
|
||||
</overrides>
|
||||
<providerName>fedmsg</providerName>
|
||||
<messageType>Custom</messageType>
|
||||
<messageProperties>topic=org.centos.prod.ci.pipeline.compose.complete
|
||||
username=fedora-atomic
|
||||
</messageProperties>
|
||||
<messageContent>{
|
||||
"build_url": "${BUILD_URL}",
|
||||
"compose_url": "<full-url-to-compose>",
|
||||
"build_id": "${BUILD_ID}",
|
||||
"ref": "fedora/rawhide/${basearch}/atomic-host",
|
||||
"rev": "<sha of the commit from dist-git>",
|
||||
"namespace": "rpms",
|
||||
"repo": "php-simplepie",
|
||||
"status": "<success/failure/aborted>",
|
||||
"test_guidance": "<comma-separated-list-of-test-suites-to-run>"}
|
||||
}</messageContent>
|
||||
</com.redhat.jenkins.plugins.ci.CIMessageNotifier>
|
||||
</publishers>
|
||||
</project>
|
20
tests/publishers/fixtures/jms-messaging-full.yaml
Normal file
20
tests/publishers/fixtures/jms-messaging-full.yaml
Normal file
@ -0,0 +1,20 @@
|
||||
publishers:
|
||||
- jms-messaging:
|
||||
override-topic: org.centos.stage.ci.pipeline.compose.complete
|
||||
provider-name: fedmsg
|
||||
msg-type: Custom
|
||||
msg-props: |
|
||||
topic=org.centos.prod.ci.pipeline.compose.complete
|
||||
username=fedora-atomic
|
||||
msg-content: |
|
||||
{
|
||||
"build_url": "${BUILD_URL}",
|
||||
"compose_url": "<full-url-to-compose>",
|
||||
"build_id": "${BUILD_ID}",
|
||||
"ref": "fedora/rawhide/${basearch}/atomic-host",
|
||||
"rev": "<sha of the commit from dist-git>",
|
||||
"namespace": "rpms",
|
||||
"repo": "php-simplepie",
|
||||
"status": "<success/failure/aborted>",
|
||||
"test_guidance": "<comma-separated-list-of-test-suites-to-run>"}
|
||||
}
|
11
tests/publishers/fixtures/jms-messaging-minimal.xml
Normal file
11
tests/publishers/fixtures/jms-messaging-minimal.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<publishers>
|
||||
<com.redhat.jenkins.plugins.ci.CIMessageNotifier>
|
||||
<providerName>fedmsg</providerName>
|
||||
<messageType>CodeQualityChecksDone</messageType>
|
||||
<messageProperties>test</messageProperties>
|
||||
<messageContent>test</messageContent>
|
||||
</com.redhat.jenkins.plugins.ci.CIMessageNotifier>
|
||||
</publishers>
|
||||
</project>
|
6
tests/publishers/fixtures/jms-messaging-minimal.yaml
Normal file
6
tests/publishers/fixtures/jms-messaging-minimal.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
publishers:
|
||||
- jms-messaging:
|
||||
provider-name: fedmsg
|
||||
msg-type: CodeQualityChecksDone
|
||||
msg-props: test
|
||||
msg-content: test
|
Loading…
x
Reference in New Issue
Block a user