Interview Prep/CI/CD/Jenkins Pipelines and Agents

A pipeline needs to trigger a downstream deploy job and wait for its result. How do you do it cleanly?

IntermediateScenarioJenkins Pipelines and Agents
Answer

Situation read → Job-to-job orchestration.

What I'd do →

def r = build job: 'deploy-service', wait: true, propagate: true,
  parameters: [string(name: 'VERSION', value: env.APP_VERSION)]
echo "Downstream: ${r.result}"

Use propagate: false if you want to handle failure yourself. Better still, fold the deploy into the same pipeline when one team owns both.

Why → Parameters carry the artifact version so the same build is promoted.

Interview tip → Too many chained jobs make traceability poor; prefer one pipeline with stages.

All CI/CD questions

More on Jenkins Pipelines and Agents