如何操纵 Jenkins 管道作业的构建结果(返回“成功")? [英] How to manipulate the build result of a Jenkins pipeline job (back to 'SUCCESS')?
本文介绍了如何操纵 Jenkins 管道作业的构建结果(返回“成功")?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在操作 Jenkins 管道的构建结果时遇到了一些麻烦.我已将其缩小到以下问题:任何人都知道为什么以下 Jenkins 管道不会使构建结果成功?相反,构建失败.
I'm having some trouble to manipulate the build result of a Jenkins pipeline. I've narrowed it down to the following issue: anyone know why the following Jenkins pipeline doesn't make the build result SUCCESS? Instead the build fails.
print "Setting result to FAILURE"
currentBuild.result = 'FAILURE'
print "Setting result to SUCCESS"
currentBuild.result = 'SUCCESS'
推荐答案
我猜这是设计使然,setResult():
// result can only get worse
if (result==null || r.isWorseThan(result)) {
result = r;
LOGGER.log(FINE, this + " in " + getRootDir() + ": result is set to " + r, LOGGER.isLoggable(Level.FINER) ? new Exception() : null);
}
这真是太可惜了
这篇关于如何操纵 Jenkins 管道作业的构建结果(返回“成功")?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文