简体   繁体   English

仅显示来自 Jenkins 管道的 Bitbucket 上的最新构建状态

[英]Only show latest build status on Bitbucket from Jenkins pipeline

Similar question has been answered already: bitbucket-build-status-notifier plugin for jenkins reports wrong status .已经回答了类似的问题: jenkins 的 bitbucket-build-status-notifier 插件报告错误状态 Indeed, setting "Only show latest build status" checkbox in job's settings solves the issue:实际上,在作业设置中设置“仅显示最新构建状态”复选框解决了这个问题:

作业设置中的复选框

I'm looking for the same ability but via Jenkins Pipeline (since a job configured as a pipeline doesn't have the checkbox mentioned above).我正在寻找相同的能力,但通过 Jenkins 管道(因为配置为管道的作业没有上面提到的复选框)。

Is it possible to set "Only show latest build status" option via Jenkinsfile for the whole job?是否可以通过 Jenkinsfile 为整个工作设置“仅显示最新构建状态”选项?

Or may be it's possible to set the option for each notification?或者是否可以为每个通知设置选项? I've tried like this but it doesn't work:我试过这样,但它不起作用:

...
post {
    success {
        bitbucketStatusNotify(
            buildState: 'SUCCESSFUL',
            onlyShowLatestBuildStatus: true
       )
    }

    ...
}
...

Without having the Plugin installed but I also need often the translation from GUI to scripted pipeline.没有安装插件,但我也经常需要从 GUI 到脚本管道的转换。 You can use this tool shipped with jenkins:您可以使用 jenkins 附带的这个工具:

https://yourJenkins/pipeline-syntax/ https://yourJenkins/pipeline-syntax/

You will find your plugin with GUI and can generate the script.您将找到带有 GUI 的插件并可以生成脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM