我有一个Jenkins管道,它有多个阶段,例如:
node("nodename") {
stage("Checkout") {
git ....
}
stage("Check Preconditions") {
...
if(!continueBuild) {
// What do I put here? currentBuild.xxx ?
}
}
stage("Do a lot of work") {
....
}
}
Run Code Online (Sandbox Code Playgroud)
如果不满足某些先决条件并且没有实际工作要做,我希望能够取消(而不是失败)构建.我怎样才能做到这一点?我知道currentBuild变量可用,但我找不到它的文档.