Interview Prep/Jenkins/Declarative pipeline syntax

How do you trigger another job from a pipeline and pass parameters?

BeginnerConceptDeclarative pipeline syntax
Answer
def r = build job: 'deploy/shack-api', wait: true, propagate: false,
  parameters: [string(name: 'IMAGE_TAG', value: env.TAG), booleanParam(name: 'DRY_RUN', value: false)]
echo "Downstream result: ${r.result}, build ${r.number}"

Use relative paths like ../deploy inside folders. propagate: false keeps the upstream build from failing automatically so you can decide. wait: false fires and forgets.

All Jenkins questions Roadmap: Jenkins

More on Declarative pipeline syntax