[英]Stage final after fail the pipeline-jenkins
I have a pipeline-jenkins also I use a jenkinsfile with several stage, How can I do If in a stage the pipeline fail after that a stage is exacuted? 我有一个pipeline-jenkins,也使用了几个阶段的jenkinsfile,我该怎么办?如果在某个阶段中某个阶段被执行后管道失败了? For instance to stop and remove several docker container. 例如停止并删除几个docker容器。
Thanks 谢谢
try/catch to get the error, finally block to do the "final" stage ? 尝试/捕获以获取错误,最后阻止以执行“最终”阶段?
try {
stage name: "something":
} catch (err) {
// handle errors here ?
} finally {
stage name: "cleanup"
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.