JMS Messaging Providers
Older versions of this plugin may not be safe to use. Please review the following warnings before using an older version:
Before the plugin may be used, you must add a JMS Messaging Provider. This will provide the ability to send and receive messages. Below is a list of currently supported JMS Message Providers:
Example:
unclassified:
jmsProviders:
configs:
- fedMsg:
name: "Fedora messages"
hubAddr: "tcp://example.com:5678"
pubAddr: "tcp://example.com:6789"
topic: "org.fedora.bar"
- activeMq:
name: "Active MQ"
broker: "foo.com:4242"
topic: "active.mq.com"
topicProvider: "default"
useQueues: false
authenticationMethod:
simple:
username: "foo"
password: "bar" # User, encrypt secrets
- rabbitMq:
name: "Rabbit MQ"
exchange: "ex"
hostname: "rabbitmq.example.com"
portNumber: "4545"
queue: "foo.bar"
topic: "baz"
virtualHost: "rabbitvh.example.com"
authenticationMethod:
sslCertificate:
keystore: "/tmp/key"
keypwd: "keypwd" # User, encrypt secrets
truststore: "/tmp/trust"
trustpwd: "trustpwd" # User, encrypt secrets
To enable the CI trigger, go to the job configuration page and add click the check box "CI Event" under the Build Triggers section. Enabling the trigger on a job requires two additional pieces of information:
The complete documentation for JMS selectors can be found here: http://activemq.apache.org/selectors.html
In the image above, the selector contains CI_TYPE = '\<message-type>'
The valid values for '\<message-type>' can be found in the "Type" column in the table below:
Message | Description | Type |
---|---|---|
Code quality checks done | Indicate that static analysis covering code quality is complete. | code-quality-checks-done |
Component build done | Indicate that a component has been built. | component-build-done |
Component functional test coverage done | Indicate that test coverage for component tests is complete. | functional-test-coverage-done |
Custom | Indicate a custom event not covered by the other message types. | custom |
Early performance testing done | Indicate that early automated performance testing is complete. | early-performance-testing-done |
Early security testing done | Indicate that early automated security testing is complete. | early-security-testing-done |
Engineering product build accepted for release testing | Indicate that engineering product build has been accepted as a release candidate. | product-accepted-for-release-testing |
Engineering product build in staging environment | Indicate that engineering product build has been pushed to staging environment. | product-build-in-staging |
Functional testing done | Indicate that all planned functional testing is complete. | functional-testing-done |
Image Uploaded | Indicate that a cloud image has been uploaded | image-uploaded |
Nonfunctional testing done | Indicate that all planned nonfunctional testing is complete. | nonfunctional-testing-done |
Out of the box testing done | Indicate that end user testing is complete. | ootb-testing-done |
Peer review done | Indicate that development has completed peer review of the code change. | peer-review-done |
Product build done | Indicate that a new product build is complete. | product-build-done |
Product test coverage done | Indicate that test coverage for functional product tests is complete. | product-test-coverage-done |
Pull request submitted | Indicate that a code change needs to be reviewed and tested. | pull-request |
Security checks done | Indicate that static analysis covering security issues is complete. | security-checks-done |
Tier 0 testing done | Indicate that tier 0 (unit) testing has completed. | tier-0-testing-done |
Tier 1 testing done | Indicate that tier 1 (component) testing is complete. | tier-1-testing-done |
Tier 2 build validation done | Indicate that the build validation is complete. | tier-2-validation-testing-done |
Tier 2 integration testing done | Indicate that tier 2 (functional product) automated testing is complete. | tier-2-integration-testing-done |
Tier 3 testing done | Indicate that tier 3 testing is complete. | tier-3-testing-done |
Unit test coverage done | Indicate that test coverage for unit tests is complete. | unit-test-coverage-done |
Update defect status | Indicate a code change to resolve a defect has been reviewed and tested and the defect status needs to be updated. | update-defect-status |
This plugin provides a build step for publishing messages to the topic upon job completion. To add the CI Notifier build step, go to the job configuration page and select the "CI Notifier" option.
Adding the step to the job requires some additional information:
The full list of message types available in the drop-down menu can be found in the Message Type table above.
This plugin provides a build step to wait for a specific message. To add the CI Subscriber build step, go to the job configuration page and select the "CI Subscriber" option.
Adding the step to the job requires some additional information:
The build step will set an environment variable with the name from Variable with a value of the message content.
See above.
The CI trigger is available via the triggers section in a declarative pipeline:
triggers {
ciBuildTrigger(noSquash: false,
providerList: [ activeMQSubscriber(name: 'Red Hat UMB',
checks: [
[
expectedValue: '^foo.*bar$',
field: '$.msg.tag'
]
],
overrides: [topic: 'Consumer.rh-jenkins-ci-plugin.8dad9900-abcabc.VirtualTopic.eng.ci.example.durable.test.abcabc'] )
]
)
}
Here is a usage example for Job DSL:
ciBuildTrigger {
providers {
providerDataEnvelope {
providerData {
activeMQSubscriber {
name("Red Hat UMB")
overrides {
def uuid = "4ba46bbc-949b-11e8-b83f-54ee754ea14c"
topic("Consumer.rh-jenkins-ci-plugin.${uuid}.VirtualTopic.eng.ci.redhat-container-image.pipeline.running")
}
// Message Checks
checks {
msgCheck {
field('$.artifact.type')
expectedValue("cvp")
}
}
}
}
}
}
noSquash(true)
}
}
This plugin provides the steps when using the Jenkins Pipeline feature:
Here are some examples:
node('master') {
// Send a message that CodeQualityChecksDone
def sendResult = sendCIMessage \
providerName: 'default', \
messageContent: 'some content', \
messageProperties: 'CI_STATUS = passed', \
messageType: 'CodeQualityChecksDone'
// echo sent message id and content
echo sendResult.getMessageId()
echo sendResult.getMessageContent()
}
and
node('master') {
// Wait for message and store message content in variable
def msgContent = waitForCIMessage \
providerName: 'default', \
selector: "CI_TYPE = 'code-quality-checks-done' and CI_STATUS = 'passed'"
echo "msgContent = " + msgContent
}
WARNING: This version contains a regression involving the display of job configuration data of Pipeline jobs. Please use v1.1.17
Ensure only admins can perform testConnection() (#104)
The jms-messaging-plugin defaults to org.fedoraproject if no topic override is specified (#101)
Trigger thread is dying with an unhandled exception. (#100)
Do not override PATH variable (#88)
Fix defaults to work. Remove obsolete code. Some general cleanup. (#87)
MESSAGE_HEADERS should include all message headers. (#82)
Update pom to new parent and fix deps (#86)
MESSAGE_HEADERS should include all message headers. (#83)
Change provider selection to use a dropdownDescriptorSelector. (#79)
Breaking change
WARNING: Version 1.0.39 no longer supports a JMS selector for the FedMsg Messaging Provider. You must update your jobs to add a Message Check to specify what you want to trigger on.
Do not block Jenkins load when previous plugin's ancestor's descriptor has been detected.
Improve interpolation of environment variables in messages
Add logging for pipeline steps
Add failOnError support for sending messages
Add support for replacing tokens using previously defined properties
Refactor pipeline steps so logging and aborting works properly.
fix missing fillProviderMethod for waitForCIMessage
fix NPE for GlobalCIConfiguration.getFirstProviderOverrides