Search code examples
spinnaker

Best practices for passing parameters from one pipeline to another


We're trying to use spinnaker(with kubernetes/helm) to roll out multiple parameterized stacks and gradually promote the new one in an application where each stack has its own database.

We've divided up the applications into microservices and each one has a deployment pipeline which is triggered by the dependent pipeline: so it's something like bake and deploy batch job -> start background services -> start user-facing layer

There's a couple parameters we want to pass throughout the process, getting injected at the bake stage to make sure everything is consistently labelled and looking at the right database.

Currently we are using

${trigger['parentExecution']['trigger']['parameters']['myParam']}

for the next pipeline, and I can only imagine from there it gets uglier with

${trigger['parentExecution']['trigger']['parentExecution']['trigger']['parameters']['myParam']}

and so on?

Is there a better way to do this?


Solution

  • Nope, looks like it is a general way - because pipeline itself keeps all execution context. But you can make trigger in other ways:

    • call pipelines directly using "Pipeline" Stage
    • call Webhook trigger and pass all reruired parameters