Skip to content

Instantly share code, notes, and snippets.

@abayer
Created November 10, 2016 00:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save abayer/02d13d1cf9546fc4b96179384a5f2a34 to your computer and use it in GitHub Desktop.
Save abayer/02d13d1cf9546fc4b96179384a5f2a34 to your computer and use it in GitHub Desktop.
#!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