故障/通过脚本返回code不稳定 [英] Failure / Unstable via Script Return Code
问题描述
我想获得我的詹金斯的结果建立工作要么失败(红色),不稳定(黄色)或全成(绿色)...
I would like to get the result of my jenkins build job either failed (red), unstable (yellow) or successfull (green)...
如果我从我的shell脚本返回非零我只能得到失败。是否有任何回报code产生不稳定的?
If i return non zero from my shell script i can only get failed. Is there any return code which produces unstable ?
推荐答案
没有。脚本退出code不会产生不稳定
在詹金斯创建结果。
No. A script exit code will not produce UNSTABLE
build result in Jenkins.
只有这样,才能通过詹金斯设置不稳定
创建结果被编程。
The only way to set UNSTABLE
build result is programmatically through Jenkins.
这是在 测试工具詹金斯部分做了什么。
This is what the test harness portion of Jenkins does.
您也可以使用 詹金斯CLI 直接在脚本来设置当前正在执行的构建的结果。而不是返回特定的出code,都有你的脚本执行詹金斯CLI命令。有关详细信息,在自己的服务器上,转到的http://<您的服务器> / CLI /命令/设置集结结果
也有一些插件,可以做同样的,其中包括:
There are also a number of plugins that can do that same, including:
- 文字,取景器插件 。
- 构建失败插件 (它可以设置任何状态),但你需要与 条件生成步骤一起使用 插件。
- Groovy插件 (将需要找出充分的Groovy code)。
- Groovy的生成后插件 (自带简单的方法来设置编译结果)。
这篇关于故障/通过脚本返回code不稳定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!