According to
https://support.atlassian.com/bitbucket-cloud/docs/deployment-concurrency-control/
It says: " By tracking your deployments using Bitbucket Deployments, Pipelines will automatically check if there is a deployment in progress before starting a new one to the same environment. If there is already a deployment in progress, later pipelines deploying to the same environment will be paused. "
Steps I've taken:
1. I have set up Deployments and created the staging (and production) environments in Deployments.
2. In my bitbucket_pipelines.xml I have added "deployment: staging" to my pipeline step for "Deploy to staging"
However, still, if 2 pipelines are started around the same time, both of the Deployment steps run at the same time in the 2 separate pipelines.
Only one of the deployments shows up in the Deployments tab for that environment, which ever one starts first, but, the other/second pipeline is still running the steps for the Deploy step too for the same environment.
Am I misunderstanding that the second pipeline's "Deploy to staging" step shouldn't be starting because Deployments is set up and a deployment is already running?
On this page:
https://support.atlassian.com/bitbucket-cloud/docs/set-up-and-monitor-deployments/
it also says:
"Note: you can only have one in-progress deployment in each environment. Any later pipelines that deploy to the same environment will be automatically paused. You can manually resume the paused deployment step once the in-progress deployment completes."
That's what I want to happen, but that's not what is happening in the Pipelines. What have I missed?