Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!groovy
pipeline {
agent none
stages {
stage("First") {
steps {
echo "First stage runs"
}
}
stage("Second") {
when {
0 == 1
}
steps {
echo "Second stage skipped due to condition"
}
}
stage("Third") {
steps {
error "Third stage fails"
}
}
stage("Fourth") {
steps {
echo "Fourth stage skipped due to failure"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.