Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
steps {
    input message: 'Approve deployment to Production environment?'

    <manually approved steps here>
}

You can also request approval by one or more specific submitters…

Code Block
stage ('Approve?')
{
    timeout(time:4, unit:'HOURS')
    {
        input message: 'Approve deployment?', submitter: MY_APPROVERS
    }
}
Info

Note that the ability to specify a Group as a submitter is, at the time of writing, still subject to an improvement request.

You can also script a more sophisticated solution, if required. The following example script renders a drop down list from which a user can choose a deployment target:

Code Block
stage ('Wait for user to specify deployment target') {
    steps {
        script {
             def userInput = input(
                 id: 'userInput', message: 'Deploy target?',
                 parameters: [[
                     $class: 'ChoiceParameterDefinition', 
                     defaultValue: 'strDef', 
                     description:'describing choices', 
                     name:'nameChoice', 
                     choices: "QA\nUAT\nProduction"
                 ]]
             )
            println(userInput); //Use this value to branch to different logic if needed
        }
    }
}

...