Merge "feat: support the skip-notifications-trait plugin for git repos"

This commit is contained in:
Zuul 2020-09-25 07:45:27 +00:00 committed by Gerrit Code Review
commit 35457bfd1c
5 changed files with 11 additions and 0 deletions

View File

@ -302,6 +302,9 @@ def git(registry, xml_parent, data):
(default false)
* **honor-refspec** (`bool`) - Perform initial clone using the refspec
defined for the repository (default false)
* **skip-notifications** (`bool`) - Skip build status notifications
(default false). Requires the Jenkins
:jenkins-plugins:`Skip Notifications Trait Plugin <skip-notifications-trait>`.
* **sparse-checkout** (`dict`)
* **paths** (`list`) - List of paths to sparse checkout. (optional)
* **submodule** (`dict`)
@ -626,6 +629,10 @@ def git_extensions(xml_parent, data):
).lower()
if "reference-repo" in data:
XML.SubElement(ext, "reference").text = str(data["reference-repo"])
skip_notifications = data.get("skip-notifications", False)
if trait and skip_notifications:
trait_name = "com.cloudbees.jenkins.plugins.bitbucket.notifications.SkipNotificationsTrait"
XML.SubElement(xml_parent, trait_name)
if not trait and "sparse-checkout" in data:
ext_name = impl_prefix + "SparseCheckoutPaths"
ext = XML.SubElement(xml_parent, ext_name)

View File

@ -96,6 +96,7 @@
<timeout>100</timeout>
</extension>
</jenkins.plugins.git.traits.CloneOptionTrait>
<com.cloudbees.jenkins.plugins.bitbucket.notifications.SkipNotificationsTrait/>
<jenkins.plugins.git.traits.SubmoduleOptionTrait>
<extension class="hudson.plugins.git.extensions.impl.SubmoduleOption">
<disableSubmodules>false</disableSubmodules>

View File

@ -67,5 +67,6 @@ scm:
parent-credentials: true
timeout: 100
timeout: "100"
skip-notifications: true
use-author: true
wipe-workspace: true

View File

@ -78,6 +78,7 @@
<timeout>100</timeout>
</extension>
</jenkins.plugins.git.traits.CloneOptionTrait>
<com.cloudbees.jenkins.plugins.bitbucket.notifications.SkipNotificationsTrait/>
<jenkins.plugins.git.traits.SubmoduleOptionTrait>
<extension class="hudson.plugins.git.extensions.impl.SubmoduleOption">
<disableSubmodules>false</disableSubmodules>

View File

@ -64,5 +64,6 @@ scm:
parent-credentials: true
timeout: 100
timeout: "100"
skip-notifications: true
use-author: true
wipe-workspace: true