Created
January 16, 2017 09:58
-
-
Save tszpinda/69b5b9c0f2aaf261be23198b70e1f392 to your computer and use it in GitHub Desktop.
Jenkins 2 pipelie input example
This file contains hidden or 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
stage('UA') { | |
echo 'start' | |
def answer = userWantToKeepCluster() | |
echo "will keep cluster? $answer" | |
echo 'done' | |
} | |
def userWantToKeepCluster() { | |
try { | |
timeout(time: 1, unit: 'MINUTES') { | |
def keep = input message: 'Keep cluster?', | |
parameters: [booleanParam(defaultValue: false, description: 'Make sure to destroy cluster manually after you done', name: 'keepCluster')] | |
return keep | |
} | |
} catch(e) { | |
return false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment