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.