Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Bitbucket pipeline stages

Divya.Puttappa
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 4, 2024

 

Can we use the prod environment under deployment in a single pipeline multiple times?

As i encountered the below error 

 

The deployment environment 'prod' in your bitbucket-pipelines.yml file occurs multiple times in the pipeline. Please refer to our documentation for valid environments and their ordering.

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 5, 2024

Hello @Divya.Puttappa ,

and welcome to the Community!

You can have only one occurrence of a deployment environment per pipeline. If you are looking for a multi-step deployment, then you can make use of stages, which allow you to define a deployment with multiple steps :

pipelines:
  default:
  - step:
      name: Build and test
      script:
        - sh ./build-app.sh
  - stage:
      name: Deploy to staging
      deployment: staging
      steps:
        - step:
            name: Deploy
            script:
              - sh ./deploy-app.sh
        - step:
            name: Run end-to-end tests
            script:
              - sh ./run-e2e-tests.sh

In the example above, there's a deployment stage composed of two steps, which are deploying to the staging environment.

However, just like with individual steps, it's not possible to have multiple stages deployments to the same environment. 

I hope that helps to clarify! Let us know in case you have any questions.

Thank you, @Divya.Puttappa !
Patrik S

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events