Created
January 29, 2019 19:41
-
-
Save hayderimran7/eea0a66392d5617293f24796e3da06b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This example shows how to use nested conditions for `when` in jenkinsfile for declarative pipeline syntax | |
def skip_docker = true | |
pipeline { | |
agent any | |
{ | |
stages { | |
stage('some stage') { | |
when { | |
allOf { | |
expression { | |
skip_docker == false | |
} | |
anyOf { | |
branch 'master' | |
branch 'skip_docker_build' | |
branch 'whatever' | |
} | |
} | |
} | |
} | |
} | |
} | |
// This stage will run if skip_docker is false AND branch is set to any of 'master' 'skip_docker_build' 'whatever' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment