问题描述
禁用定期构建失败的首选方法是什么?快速搜索显示有一个先决条件构建步骤插件,但构建失败,我需要完全禁用构建,直到手动干预.
What is the preferred way to disable the periodical build when it has failed? Quick search showed that there is a Prerequisite build step plugin, but that fails the build, and I need the build to be completely disabled until manual intervention.
谢谢.
推荐答案
好吧,我想我找到了解决方案.
Okay, I think I managed to find a solution.
- 重试失败的构建插件不起作用,因为它无法覆盖默认的项目时间表,因此失败的项目一次又一次地构建.
- Naginator 插件无法使用,因为延迟不可配置.
- 先决条件构建步骤插件不合适.
解决方案是安装Groovy Postbuild Plugin,它在 Jenkins JVM 下运行并公开公开 Jenkins 实例.因此可以直接在项目配置中以编程方式禁用当前构建:
The solution is to install the Groovy Postbuild Plugin, which is run under the Jenkins JVM and exposes the Jenkins instance publically. So it is possible to programmatically disable the current build directly in the Project configuration:
if (manager.build.result.isWorseThan(hudson.model.Result.SUCCESS)) {
manager.build.project.disabled = true
}
这篇关于Hudson/jenkins:禁用失败的构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!