for infra as code deployments I want to have following pipeline structure:
stage1: validate and plan for dev
stage2: apply for dev
and
repeat the same for another env
both plan and apply stages need authentication and uses deployment vars for that, but in bitbucket pipelines you can't have two stages with deployment to same env and there is no way to use same vars in both stages?
The obvious solution is to do "plan and apply" in a single stage, but I really like the logical grouping of steps to stages by the intent (plan/apply build/deploy etc.) am I thinking wrong here?
On top of that I can't use single stage because for the apply part I need some kind of approval and I couldn't find how to implement it except via "manual trigger" workaround, which can only be defined on stage level.
Hi Aurimas,
Multiple steps in the same pipeline cannot reference the same deployment environment, so stages were introduced to address this limitation. With a stage, you can have multiple steps grouped in the same stage that share the same deployment environment.
If the manual trigger is a requirement, you can create a separate custom pipeline for the steps you would use in stage 2 and trigger it manually:
You can trigger a custom pipeline for a branch or for a specific commit (in case you want to run it for an earlier commit of a certain branch). You can find more info on how to trigger a pipeline manually here:
We have a request in our issue tracker for supporting manual trigger for a step in a stage that you can vote for to express your interest:
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.