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 accepted

1 vote
Answer accepted
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

Aurimas N_ May 6, 2024

> 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:

I really can't because I can't access same deployment in the second stage.

In this case allowing manual trigger on a step in a stage would be a workaround, but the real problem is not being able to reference same deployment in multiple stages, the reason for this must be some technical limitation because having multiple stages per environment seems only logical.

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 7, 2024

Hi Aurimas,

Thank you for the feedback. I went ahead and created a feature request for multi-stage deployments in our issue tracker:

I would suggest adding your vote and comment there to express your interest.

Implementation of features is done as per our policy here and any updates will be posted in the feature request.

Kind regards,
Theodora

Suggest an answer

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

Atlassian Community Events