Jenkins/vars/utils.groovy

13 lines
307 B
Groovy

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)
}
}