Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Tag and lock a branch for a release

Tom O'Hare July 3, 2014

What is the best way to automate adding a tag to a branch and changing the permission of the branch (read-only)? I need to do this to automate a release process across multiple Stash repo branches.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
TimP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 15, 2014

Hi Tom,

You could write a script that creates and pushes a tag over HTTPS/SSH and then restricts the branch via the branch permissions REST API, but I'd consider whether you really need to lock the branch?

Once you create a tag, it is fixed pointing a particular commit, so as long as your release process is using tags you don't have to worry if the branch the tag was originally created on is updated or not. You could even experiment with the Ref Change Settings plugin from Atlassian Labs (though you'll have to build it from source) if you wanted to ensure tags are not updated in your repository.

cheers,

Tim

Tom O'Hare July 16, 2014

Hi Tim,

Yes, this makes sense and I am proceeding to use git annotated tags to define the release. Are there plans to add the release concept in Stash and tie into Jira and Bamboo? GitHub has this capability today:

https://github.com/blog/1547-release-your-software

Thanks,

Tom

TimP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 16, 2014

Bamboo supports storing artifacts for you (or pushing them to a separate host after being built), but we don't have "releases" as a first class concept in Stash at the moment. That said, we're always keen for feedback - I'd recommend raising a feature request in the Stash project at https://jira.atlassian.com

Tom O'Hare July 16, 2014

Thanks, I added this feature request:

https://jira.atlassian.com/browse/STASH-5005

TimP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 16, 2014

Nice, you have my vote. If you're happy with this answer would you mind marking it as accepted?

TAGS
AUG Leaders

Atlassian Community Events