哈德森/詹金斯:禁用失败的构建 [英] Hudson/jenkins: disable the failed build

查看:83
本文介绍了哈德森/詹金斯:禁用失败的构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当定期构建失败时,首选的禁用方式是什么?快速搜索显示,有一个Prerequisite build step插件,但是构建失败,因此我需要完全禁用该构建,直到手动干预为止.

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插件,它在Jenkins JVM下运行,并公开公开Jenkins实例.因此可以直接在Project配置中以编程方式禁用当前版本:

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
}

这篇关于哈德森/詹金斯:禁用失败的构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆