Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luizrobertofreitas/0cb6347385ae39fa7d7441edb46f066a to your computer and use it in GitHub Desktop.
Save luizrobertofreitas/0cb6347385ae39fa7d7441edb46f066a to your computer and use it in GitHub Desktop.
Openshift DSL imagestreamtag exists
pipeline {
agent any
environment {
def imageStreamTagExists = false
}
stages {
stage('Image stream tag') {
steps {
script {
openshift.withCluster() {
openshift.withProject("project") {
imageStreamTagExists = openshift.selector("imagestreamtag", "appname:1.0.0").exists()
echo "Image Stream Tag exists? ${imageStreamTagExists}"
}
}
}
}
}
stage('Testing') {
when {
expression {
!imageStreamTagExists
}
}
steps {
script {
echo "Do not exist"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment