简体   繁体   English

Jenkins Workflow插件如何使构建失败

[英]Jenkins Workflow Plugin How to Fail a Build

I'm currently using the Jenkins Workflow plugin, I have a master groovy script that calls other child groovy scripts. 我目前正在使用Jenkins Workflow插件,我有一个调用其他子groovy脚本的主groovy脚本。

What would be best way to fail the build from the child script such? 什么是从子脚本失败构建的最佳方法? At the moment I'm throwing an exception from the child script but this create a lot of output in the console since it prints the whole stack trace. 目前我正在从子脚本中抛出异常,但这会在控制台中创建大量输出,因为它会打印整个堆栈跟踪。

Is there a cleaner way to do this? 有更清洁的方法吗? Return a certain value from the child script or set a certain object? 从子脚本返回某个值还是设置某个对象?

使用error步骤,该步骤不会打印堆栈跟踪。

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

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