How to Automate Tag Creation on Bitbucket? Edited

I want to create a Tag corresponding to a successful build of a given branch  (say develop or release). 

That is whenever there's a success of build on newly pushed/merged code, I want to kickoff a Script or something like that which can create a Tag for current state of that branch.

Couldn't find anything even related on community so directly asking here.

1 answer

0 vote

Where are you building the code? Bamboo, Jenkins? Most CI apps have a script task that you can use to create tags and push to Bitbucket using the git commands.

Make sure you have SSH keys added on the machines where the build is running and are given the right permissions in Bitbucket.

Hi Jobin, We're using Jenkins for CI & CD. But I couldn't find any way to create tags and push to Bitbucket using the git commands.

 

Yes, I have SSH keys added on the machines where the build is running and are given the write permissions in Bitbucket.

 

A reference could be a help.

 

Thank you for replying.

And it would be good if I could skip Jenkins from the way and Just use Bit Bucket Merge Checks, Event Handlers or Script Post Hooks etc.

You can just add a sheel script and execute it from the build.

The script will have "git tag .." and "git push .." commands to create a tag and push it to the remote. Make sure you are in the correct repo before you tag it.

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 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

135 views 17 6
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