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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.