Interview Prep/Jenkins/Pipeline design & Jenkinsfile decisions

Product asks for a "deploy any version to any environment" button. How do you design the job?

IntermediateScenarioPipeline design & Jenkinsfile decisions
Answer

Situation read → Separate the promotion/deploy job from the CI pipeline, deploying existing artifacts only.

What I'd do →

  1. Create a parameterized pipeline deploy/shack-app with choice(name: 'ENV', choices: ['dev','staging','prod']) and string(name: 'TAG').
  2. Validate the tag exists in the registry (crane digest $IMAGE:$TAG) and was built from main.
  3. Gate prod with a stage input restricted to release-managers, and use folder permissions so only certain groups can build the job.
  4. Record currentBuild.displayName = "${params.ENV} ${params.TAG}" for an audit-friendly history.

Why → Deploying artifacts by tag never rebuilds and gives a clear deployment log per environment.

Interview tip → Say that with GitOps, this job would open a PR to the config repo instead of calling kubectl.

All Jenkins questions Roadmap: Jenkins

More on Pipeline design & Jenkinsfile decisions