Jenkins中具有Bitbucket构建状态通知程序插件的多分支管道 [英] Multi branch pipeline with bitbucket build status notifier plugin in jenkins
问题描述
我的jenkins服务器中有一个多分支管道作业,我尝试使用bitbucket cloud构建状态通知程序插件通知构建状态.
I have a multi branch pipeline job in my jenkins server and I tried to notify the build status using bitbucket cloud build status notifier plugin.
我配置了通知程序中提供的设置插件,并在Jenkinsfile的开头和结尾添加了通告程序脚本功能.
I configured the settings provided in notifier plugin and added the notifier script function in the beginning and end of my Jenkinsfile.
Jenkinsfile:
node {
stage 'Build'
bitbucketStatusNotify ( buildState: 'INPROGRESS' )
.......
.......
bitbucketStatusNotify ( buildState: 'SUCESS' )
}
当我运行jenkins构建时,它会触发通知程序脚本并在控制台中返回done语句.
When I run the jenkins build it trigger the notifier script and return done statement in the console.
Entering stage Build
Proceeding
[Pipeline] bitbucketStatusNotify
Sending build status INPROGRESS for commit 84bf788cc9ccc8c31df5719da383cab003c97582 to BitBucket is done!
[Pipeline] bat
[master] Running batch script
但是通知程序图标在位桶云中不可见或未设置.
But the notifier icon is not visible or set in the bitbucket cloud.
有什么我想配置的东西吗?
Is there anything I missed to configure?
推荐答案
documentation/releasenotes at https://wiki.jenkins-ci.org/display/JENKINS/Bitbucket+Cloud+Build+Status+Notifier+Plugin
说 使用Jenkins 2管道 在您的Jenkinsfile的开头添加以下内容:
says Using Jenkins 2 pipeline Add the following at the beginning of your Jenkinsfile:
bitbucketStatusNotify ( buildState: 'INPROGRESS' )
并在Jenkinsfile的末尾添加以下内容:
And add the following at the ending of your Jenkinsfile:
bitbucketStatusNotify ( buildState: 'SUCCESSFUL' )
github上的自述文件更完整: https://github.com/jenkinsci/bitbucket-build-status-notifier-plugin
the readme on github is more complete: https://github.com/jenkinsci/bitbucket-build-status-notifier-plugin
这篇关于Jenkins中具有Bitbucket构建状态通知程序插件的多分支管道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!