Jenkins pipeline: interactive input during process
Input during the process
examples/jenkins/input.jenkinsfile
pipeline { agent { label 'master' } stages { stage('build') { steps { echo "Hello World!" //input("Continue?") echo "OK" //input( // message: 'Was this successful?', parameters: [ // [$class: 'BooleanParameterDefinition', defaultValue: true, description: '', name: 'Please confirm you agree with this'] //]) /* script { res = input( message: 'Was this successful?', parameters: [ [$class: 'BooleanParameterDefinition', defaultValue: false, description: '', name: 'Apple'], [$class: 'BooleanParameterDefinition', defaultValue: false, description: '', name: 'Banana'] ]) print(res) } */ script { values = ['Apple', 'Banana', 'Peach'] parameters = [] values.each { echo it parameters.add( [$class: 'BooleanParameterDefinition', defaultValue: false, description: '', name: it ] ) } res = input( message: 'Was this successful?', parameters: parameters ) print(res) } // input( // message: 'What now?', parameters: [ // [$class: 'AppDetectorParamaterDefinition') // ]) //echo result // python scripts/aws_instances.py --what selftest --command start } } } }
Published on 2020-07-03
If you have any comments or questions, feel free to post them on the source of this page in GitHub. Source on GitHub.
Comment on this post