How do `input` steps and manual approvals work in Jenkins?
IntermediateConceptJenkins
Answer
The input step pauses the pipeline until a user clicks Proceed or Abort, optionally restricted to specific users via submitter and optionally collecting parameters. Put it inside a stage with agent none or after leaving the node block; otherwise the pipeline holds an executor while waiting. Add a timeout so abandoned pipelines do not hang forever.
stage('Approve') {
agent none
steps {
timeout(time: 2, unit: 'HOURS') {
input message: 'Deploy to production?', submitter: 'release-managers'
}
}
}
More on Jenkins
What is Jenkins and how is its architecture organised?BeginnerWhat are executors, nodes and labels in Jenkins?IntermediateWhy should you not run builds on the Jenkins controller?BeginnerHow do inbound (JNLP/WebSocket) and SSH agents connect to the controller?IntermediateWhat is a Jenkinsfile and where does it live?BeginnerDeclarative versus Scripted Pipeline: what are the differences?Intermediate