将构建状态从 Jenkins 通知到 Bitbucket Server

Notify build status from Jenkins to Bitbucket Server

我们已经在内部安装了 Jenkins v2.7.3 和 Bitbucket Server v4.9.1,并希望将构建状态作为通知从 Jenkins 发送到 Bitbucket Server。

到目前为止,我只找到了适用于 Bitbucket Cloud 的解决方案(1 和 2),但没有找到适用于 Bitbucket Server 的解决方案。关于如何实现这一目标的任何提示?

  1. https://wiki.jenkins-ci.org/display/JENKINS/Bitbucket+Cloud+Build+Status+Notifier+Plugin
  2. https://wiki.jenkins-ci.org/display/JENKINS/Bitbucket+OAuth+Plugin

您可能会从 stash plugin as BitBucket is based on Stash code 中得到一些用处。

A​​tlassian 的评价:

We have unified our Git products under the Bitbucket name. With
Bitbucket, now you have a range of options that can be adopted by teams
of all sizes and requirements: Bitbucket Cloud (previously known as
Bitbucket), Bitbucket Server (previously known as Stash) and Bitbucket
Data Center (previously known as Stash Data Center). 

关于插件:

This plugin notifies an Atlassian Stash instance of Jenkins builds in
progress and of their results. The build results will show up in the
commit list in Stash or in a Stash pull request and provide immediate
and easy to scan feedback about a commit. It is possible to navigate 
from build result information in Stash directly to the build in 
question. The plugin can be configured on a per-job basis, globally 
for all Jobs or both to minimize the configuration overhead.

您需要 Stash Pull Request Builder 插件 这个 Jenkins 插件构建来自 Atlassian Stash 服务器的拉取请求,并将测试结果报告为评论。该插件的灵感来自 GitHub 和 BitBucket 拉取请求生成器插件

https://plugins.jenkins.io/stash-pullrequest-builder

最新版本的 Stash Notifier 插件现在可以与 Job DSL 一起使用

可以从 Jenkins 的 Bitbucket server integration plugin 无缝发布构建状态。此插件由 Atlassian 创建和维护。

但是,您必须将 Bitbucket 服务器从 v4.9.1 升级到至少 v5.6。最好是 v7.4+,以便在 Bitbucket Server 中使用新的 build functionality

Jenkins 的 Bitbucket Server Notifier 插件为我完成了这项工作(Jenkins 与 Bitbucket Server 的集成——以前称为 Stash)。

https://plugins.jenkins.io/stashNotifier/#documentation 用法:https://github.com/jenkinsci/stashnotifier-plugin/blob/release/1.x/readme.md