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.
More on Declarative pipeline syntax
What is the minimum valid declarative pipeline?BeginnerWhat agent types exist in declarative pipelines?IntermediateWhen do you use `agent none` at the top level?IntermediateHow do nested sequential stages work and why are they useful?IntermediateList the `post` conditions and when each fires.IntermediateWhat are the most useful `when` conditions?Intermediate