If I push to a branch whilst a build is already running, then another build is triggered. This causes problems since my builds use the shared environment. How can I force the pipeline to only run one build at a time and any commits that are pushed, are queued for the next build?
Hi @AshTappin_BP ,
Are both builds deploying to the same environment defined in Repository settings > Deployments?
If there is a build running that deploys to a certain deployment environment that you have defined in Repository settings > Deployments, and a second build is triggered that deploys to the same environment, then the second build gets paused and you can resume it manually when the first one finishes.
Are you using deployment environments in your yml file? Could you share the yml file you are using, so we can better help you? You may remove the commands in the scripts and just add a description of what each step does if you don't feel comfortable sharing the exact yml file here; it would be useful to have an overview of the steps and understand where the problem arises.
Thank you for your reply @Theodora Boudale I am using deployments but only for the deployment steps. Here is a summary of my yaml file:
name: "Provision CI"
name: "Deploy to CI"
name: Acceptance Test
I tried adding deployment: test to every step but that wasn't allowed. I could collapse the steps into one big step. The main problem is when the Acceptance Test step is running another build could start and run the Provision CI step which alters the environment Acceptance test is using.
A feature request that could circumvent this problem is mentioned here https://community.atlassian.com/t5/Bitbucket-questions/Can-you-limit-the-number-of-concurrent-builds-in-pipelines/qaq-p/65932
Hi @AshTappin_BP ,
Thank you for explaining your use case, I understand the requirement.
There is indeed a feature request about this in our issue tracker:
I added a comment there quoting your previous reply, for our product managers to take into account. You can of course add any additional feedback, if you like. I would also suggest adding your vote (by selecting the Vote for this issue link). If you'd like to get notified via email on updates, you can add yourself as a watcher by selecting the Start watching this issue link. Any updates will be posted in that feature request.
For now, the only workaround I can think of is what you said as well, combine all steps into a big one and add the deployment keyword in the step. This way, any builds that are triggered when an existing one is running will be paused, and can be resumed manually from the Pipelines page.
If you have any questions, please feel free to let me know.
Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events