Interview Prep/CI/CD/Jenkins Pipelines and Agents

You need a manual approval before production, and only the release managers group may approve. How?

IntermediateScenarioJenkins Pipelines and Agents
Answer

Situation read → Gated deploy with an authorized approver list.

What I'd do →

stage('Approve Prod') {
  steps {
    timeout(time: 2, unit: 'HOURS') {
      input message: 'Deploy to production?', submitter: 'release-managers', ok: 'Deploy'
    }
  }
}

Place the input in a stage with agent none so no executor is held while waiting.

Why → submitter enforces who may proceed, and the timeout prevents abandoned pipelines.

Interview tip → Holding an agent during input is the classic mistake.

All CI/CD questions

More on Jenkins Pipelines and Agents