Add support for noSquash (no-squash) in jms-messaging trigger

It's sometimes required to trigger a job build on every CI message.
To achieve that the XML's noSquash (jjb: no-squash) has to be set to
True.

see triggers section at:
https://wiki.jenkins.io/display/JENKINS/JMS+Messaging+Plugin

Change-Id: I389e59cca4f649379614f7f6247bf76cf4a0ba95
This commit is contained in:
Waldemar Znoinski 2019-12-06 12:43:44 +00:00 committed by Thanh Ha
parent 67dc0087a7
commit 2ea9841a96
No known key found for this signature in database
GPG Key ID: 5783F720616E3180
4 changed files with 10 additions and 0 deletions

View File

@ -933,6 +933,12 @@ def jms_messaging(registry, xml_parent, data):
Requires the Jenkins :jenkins-wiki:`JMS Messaging Plugin Requires the Jenkins :jenkins-wiki:`JMS Messaging Plugin
<JMS+Messaging+Plugin>`. <JMS+Messaging+Plugin>`.
:arg bool no-squash: true = schedule a new job for every triggering message.
(default false)
Normally if a job is queued and another triggering message is received, a new job
is not submitted and the job is "squashed" into the job already queued.
Setting this option to 'True' forces a new job to be submitted for every triggering
message that is received.
:arg str override-topic: If you need to override the default topic. :arg str override-topic: If you need to override the default topic.
(default '') (default '')
:arg str selector: The JSON or YAML formatted text that conforms to :arg str selector: The JSON or YAML formatted text that conforms to
@ -968,6 +974,7 @@ def jms_messaging(registry, xml_parent, data):
mapping = [ mapping = [
# option, xml name, default value # option, xml name, default value
("spec", "spec", ""), ("spec", "spec", ""),
("no-squash", "noSquash", False),
("selector", "selector", ""), ("selector", "selector", ""),
("provider-name", "providerName", ""), ("provider-name", "providerName", ""),
] ]

View File

@ -3,6 +3,7 @@
<triggers class="vector"> <triggers class="vector">
<com.redhat.jenkins.plugins.ci.CIBuildTrigger> <com.redhat.jenkins.plugins.ci.CIBuildTrigger>
<spec/> <spec/>
<noSquash>true</noSquash>
<selector>topic = &quot;org.fedoraproject.prod.fedimg.image.upload&quot;</selector> <selector>topic = &quot;org.fedoraproject.prod.fedimg.image.upload&quot;</selector>
<providerName>fedmsg</providerName> <providerName>fedmsg</providerName>
<checks> <checks>

View File

@ -1,5 +1,6 @@
triggers: triggers:
- jms-messaging: - jms-messaging:
no-squash: True
selector: topic = "org.fedoraproject.prod.fedimg.image.upload" selector: topic = "org.fedoraproject.prod.fedimg.image.upload"
provider-name: fedmsg provider-name: fedmsg
checks: checks:

View File

@ -3,6 +3,7 @@
<triggers class="vector"> <triggers class="vector">
<com.redhat.jenkins.plugins.ci.CIBuildTrigger> <com.redhat.jenkins.plugins.ci.CIBuildTrigger>
<spec/> <spec/>
<noSquash>false</noSquash>
<selector>topic = &quot;org.fedoraproject.prod.fedimg.image.upload&quot;</selector> <selector>topic = &quot;org.fedoraproject.prod.fedimg.image.upload&quot;</selector>
<providerName>fedmsg</providerName> <providerName>fedmsg</providerName>
</com.redhat.jenkins.plugins.ci.CIBuildTrigger> </com.redhat.jenkins.plugins.ci.CIBuildTrigger>