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
           }
       }
   }
}