Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Current »

You may want to configure your pipeline to wait at certain points for a human to manually approve the pipeline to proceed. You can do this most simply using the input step plugin which will pauses Pipeline execution and present some configured text along with proceed and abort options:

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

    <manually approved steps here>
}

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:

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

See the relevant documentation here: Pipeline: Input Step (jenkins.io)

  • No labels