Interview Prep/Jenkins/Pipeline design & Jenkinsfile decisions

A release pipeline needs two approvals: QA lead, then a release manager, each from a different group. How do you model it?

IntermediateScenarioPipeline design & Jenkinsfile decisions
Answer

Situation read → Sequential gates with different submitters and audit.

What I'd do →

  1. Two stages with stage-level input and no agent:
    stage('QA sign-off') { options { timeout(time: 1, unit: 'DAYS') }
      input { message 'QA approved?'; submitter 'qa-leads'; submitterParameter 'QA_APPROVER' }
      steps { echo "QA: ${QA_APPROVER}" } }
    stage('Release approval') { options { timeout(time: 1, unit: 'DAYS') }
      input { message 'Release to prod?'; submitter 'release-managers'; submitterParameter 'RM_APPROVER' }
      steps { echo "RM: ${RM_APPROVER}" } }
    
  2. Write approver names into currentBuild.description and the change ticket.
  3. Ensure the same person cannot approve both (check QA_APPROVER != RM_APPROVER and fail).

Why → Group-restricted submitters plus recorded identities give separation of duties.

Interview tip → Mention that admins can always approve, so keep the admin group small.

All Jenkins questions Roadmap: Jenkins

More on Pipeline design & Jenkinsfile decisions