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
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.