Forums

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

How to coordinate deployments with pipelines?

mgwerder
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 15, 2016

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: https://bitbucket.org/site/master/issues/12821/sequential-pipelines-disable 

1 answer

1 vote
Tom Bradshaw
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 19, 2016

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

Cheers,

Tom.

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, mindful member, mindful member badge, atlassian community, community kudos, community giveaway, atlassian swag, community values, empathy and kindness, badge challenge, atlassian learning, community engagement, swag giveaway

Earn a Badge, Win a Prize 🎁

Earning the Mindful Member badge proves you know how to lead with kindness, plus it enters you into a giveaway for exclusive Atlassian swag. Take the quiz, grab the badge, and comment on our announcement article to spread the good vibes!

Start here
AUG Leaders

Atlassian Community Events