Forums

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

Pipeline config to allow concurrent deployments to same environment

Justin Spalti
July 13, 2024

I have a custom pipeline for each of my applications. They are structured in a way which they do not affect each other. I have four different deployment environments (dev, qa, etc). There are deployment variables which differ between each environment. In trying to see if there's a way to deploy different pipelines to the same environment at the same time. 

App A - Deploy to QA

App B - Deploy to QA

https://support.atlassian.com/bitbucket-cloud/docs/deployment-concurrency-control/

I've read that, but it seems reasonable to allow concurrent deployments to the same environment. Assuming those concurrent deployments are for different pipelines/applications. I'd be ok with going down an alternative path if there is one. It takes too long to deploy our apps one after the other. 

Additional Details: I'm using windows runners. I have multiple runners on my build machine. 

1 answer

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

Hi Justin,

I'm afraid that there is no config to allow concurrent deployments to the same environment. I can create a feature request for our development team to consider, please feel free to let me know if you'd like me to do that.

You could work around this issue in one of the following two ways:

  • Create and use multiple deployment environments. For example, instead of QA, create environments QA-A, QA-B etc.
  • Stop using deployment environments and use Repository variables instead (with different variable names for each environment).

Kind regards,
Theodora

Ankit Solanki
January 5, 2026

Hi Bitbucket team / Community,

I am facing an similar issue with my Bitbucket pipelines where branch deployments halt when multiple PRs are merged, even though concurrency groups are configured. Is this issue fixed?

Here’s my scenario:

  1. I have PR pipelines that run Salesforce validation . These pipelines run per PR branch, and concurrency works perfectly — if multiple PRs trigger validation at the same time, they queue and auto-resume once previous builds finish.

  2. I also have branch pipelines for deployments (Salesforce + Vlocity) on a branch called ankit_vlocity.

    definitions:
      steps:
       

        - step: &sf-validate
            name: Validate Salesforce (Delta)
            script:
              - ./cicd-scripts/validateDeployment.sh
            concurrency-group: salesforce-validation-${BITBUCKET_BRANCH}

        - step: &sf-deploy
            name: Deploy Salesforce (Delta)
            script:
              - ./cicd-scripts/deploySalesforce.sh
            concurrency-group: salesforce-deployment

        - step: &vlocity-deploy
            name: Deploy Vlocity (Delta)
            script:
              - ./cicd-scripts/deployVlocityDelta.sh
            concurrency-group: vlocity-deployment

    pipelines:
      pull-requests:
        "**"
              - step:
                  <<: *sf-validate
                  name: Salesforce Validation
                  deployment: devops-test

      branches:
        ankit_vlocity:
          - stage:
              name: Deploy to DevOps-Test
              deployment: devops-test
              steps:
                - step:
                    <<: *sf-deploy
                    name: Salesforce Deployment
                - step:
                    <<: *vlocity-deploy
                    name: Vlocity Deployment



     

    Problem:

    • When multiple PRs are merged to ankit_vlocity, the branch pipeline triggers multiple deployments for the same branch.

    • The pipeline initially shows as waiting, then moves to Halted stage with this message:

     

    Halted This pipeline was halted because another pipeline was deploying to devops-test.
    • I tried setting a global concurrency group (e.g., concurrency-group: vlocity-deployment) instead of using ${BITBUCKET_BRANCH}, but the problem persists.

    Observations:

    • PR validation pipelines queue and auto-resume properly, likely because each PR has its own branch concurrency queue.

    • Branch deployments halt because multiple pipelines are triggered for the same target branch/org, and Bitbucket seems to queue the entire stage, which blocks the pipeline from auto-resuming.

    Questions:

    1. Why does the branch deployment halt even when a global concurrency group is used?

    2. Is there a recommended way to configure concurrency so that multiple merged PRs deploying to the same branch/org queue properly and auto-resume?

    3. Would splitting stages or changing concurrency behavior fix this issue, or is this expected Bitbucket behavior for branch pipelines?


      Additional context:

      1. Branch deployments target the same environment (devops-test) and use stages, which seem to lock the environment per pipeline. This causes merged PRs to halt instead of queueing automatically.

      2. We tried global concurrency groups, splitting stages into multiple steps, and manual triggers, but the problem persists.

      3. Is there any way to configure branch deployments so that if another deployment is already running on the same deployment environment, the new deployment automatically goes into a queue and resumes when the previous one finishes? If not, are there any recommended workarounds to achieve this behavior?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events