Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Multiple stages for same environment with deployment vars

Aurimas N_ April 24, 2024

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.

1 answer

1 vote
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 29, 2024

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events