问题描述
如果工作失败,我不必等待所有人完成.是否可以中止仍在运行的并行阶段.它们必须显示为已终止",而不是带有红色十字图标,因为必须突出显示失败的一个.
If the job failed, I don't have to wait everybody to finish. Is it possible to abort the parallel stages that are still running. They must display as "aborted", not with a red cross icon, since the failed one must be highlighted.
推荐答案
添加 parallelsAlwaysFailFast 作为您的选择,如果任何(并行)阶段失败,整个管道将停止.
Add parallelsAlwaysFailFast to your options and the whole pipelilne will stop if any (parallelized) stage fails.
引用来源:
将所有后续并行的failfast设置为true 管道中的各个阶段.
Set failfast true for all subsequent parallel stages in the pipeline.
例如:options { parallelsAlwaysFailFast()}
For example: options { parallelsAlwaysFailFast() }
示例如何在管道中使用:
Example how to use in the pipeline:
pipeline {
agent none
options {
parallelsAlwaysFailFast()
}
stages {
...
}
}
该选项突出显示失败的阶段.不幸的是,其他阶段没有显示为aborted
,它们只是显示通常的红色(未突出显示).
The option highlights the failed stage. Unfortunately the other stages are not displayed as aborted
they just get the usual (not highlighted) red color.
这篇关于在詹金斯管道并行阶段中,如果一个阶段失败,如何迅速杀死其他阶段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!