Is there a way to lock down MASTER branch priodically?

Hello people,

Is there a cool or easy way, in Bitbucket, to lock down MASTER branch periodically (say, every Friday)?

This will be an (admittedly brute-force) approach to prevent deploys on Friday which my organisation doesn't want to do.

Or, do I need to get more into the full-fat CI tools to achieve this kind of thing?

Many thanks,

Daniel

#blueSkyThinking

2 answers

2 accepted

Are you on Bitbucket Cloud or Bitbucket Server?

If you're on Bitbucket Server, take a look at this answer, which shows how to PUT/DELETE json against the branch-permissions API end-point.

You could use cron to apply/remove a "master-is-read-only" branch-permission periodically.

Great, many thanks. So, in conclusion it's "they have an API which you can use"! That's definitely schedulable and exploitable.

0 vote

If you're using Bitbucket Cloud, you can use https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/branch-restrictions#post to set up or remove branch restrictions using the API. You may also be interested in the GUI version, https://confluence.atlassian.com/bitbucket/branch-permissions-385912271.html

Great, many thanks. So, in conclusion it's "they have an API which you can use"! That's definitely schedulable and exploitable.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 06, 2018 in Bitbucket

Do you use Bitbucket Cloud and Jira Cloud? If so, let us know!

Hi Community, I'm Julia and I'm on the Jira Software Cloud marketing team!  We're looking for companies or teams using Bitbucket Cloud and Jira Software Cloud. If your team fits the t...

65 views 1 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you