stash disable push on a repository branch

My build and release process takes several minutes from start to
finish, and during this time I want to disable pushes on the project
repository develop branch.

I found this promising plugin example

https://bitbucket.org/atlassian/stash-example-hook-protect-ref

which solves part of my problem in that I now know how to disable
pushes to the ref via the Stash Web UI and pre-receive hooks. But I would like to extend
the Stash REST API so that I can programmatically disable pushes
to a ref during the release process, then enable pushes when the
release is finished.

Can someone offer guidance on how whether extending the Stash REST API
is possible, and if so how to start on such an extension?

I am also open to and grateful for other suggestions on how to
approach an automated solution.

Thanks.

2 answers

This widget could not be displayed.
Timothy Chin Community Champion Dec 27, 2014

If your build process can call the Stash API and remove the write permissions to the branch and then restore them after they are done, that should be a viable solution.

https://developer.atlassian.com/static/rest/stash/3.0.1/stash-branch-permissions-rest.html

This widget could not be displayed.

hi,

do we have solution for this?

thanks

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Friday in Bitbucket

What is your #1 piece of advice to new users getting started using Bitbucket?

Hello Community! My name is Claire Maynard, and I’m a Product Marketing Manager on the Bitbucket team. I’m interested in hearing what advice or tips you have for new users getting started on ...

186 views 12 2
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