|
import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
|
|
|
|
void when(Boolean condition, body) {
|
|
Map config = [:]
|
|
body.resolveStrategy = Closure.OWNER_FIRST
|
|
body.delegate = config
|
|
|
|
if (condition) {
|
|
body()
|
|
} else {
|
|
Utils.markStageSkippedForConditional(STAGE_NAME)
|
|
}
|
|
} |