Jenkins declarative pipelines offer very convenient when directive with conditions like changeset.
Is is possible the this changeset and other when conditions in a scripted pipeline?
DevOps Stack Exchange is a question and answer site for software engineers working on automated testing, continuous delivery, service integration and monitoring, and building SDLC infrastructure. It only takes a minute to sign up.
Sign up to join this communityJenkins declarative pipelines offer very convenient when directive with conditions like changeset.
Is is possible the this changeset and other when conditions in a scripted pipeline?
It would seem not - in the scripted pipeline, groovy needs to be used - see the docs
node {
stage('Example') {
if (env.BRANCH_NAME == 'master') {
echo 'I only execute on the master branch'
} else {
echo 'I execute elsewhere'
}
}
}
(taken straight from the docs)
This would be the same as when { branch 'master' }