It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to coordinate deployments with pipelines?

We've been testing out Bitbucket Pipelines over the last days and so far we're quite happy with the concept and its simplicity. There is one Problem we can't solve so far: When deploying from within Bitbucket Pipelines how can we ensure that the newest build is deployed? If we have quick commits (quick depending on the time the build takes) we end up with a race between multiple builds.

Our setup is that we want every commit to the develop branch to be directly deployed to our staging environment, In our case these are usually php applications and we're using Deployer for the actual deployment.

Update Found an open issue that would fix this: 

1 answer

1 vote

Hi Marcel,

You have already found the issue to which I was going to link you. It's something we're looking into and if you have any thoughts about specific features you would like there I would invite you to comment on the open ticket. The best workaround I can think of is to add a step immediately before the deployment step which checks whether there are new commits and only if there are none does it deploy. This will not eliminate race conditions and will not deploy every version, only the latest. However, it should prevent in most cases the overwriting of deployments.

git fetch origin/<release_branch_name>
git diff origin/<release_branch_name>
if [ $? == 0 ]; then ./deploymentScript; fi



Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,112 views 0 5
Read article

Community Events

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

Events near you