Bamboo build on new git tag

We're using Stash and Bamboo. I'd like to have a build triggered on a tag whenever a tag is added to a specific branch. It seems this feature request is something along those lines, though not precisely:

https://jira.atlassian.com/browse/BAM-13618

Since this doesn't seem to be possible currently out of the box, what would be the best way to accomplish this, even if it involved some scripting?

Thanks

2 answers

1 accepted

Hi Jeff,

Unfortunately Bamboo doesn't currently have support for anything other than branches. For now you will have to create branches to match your tags. There really isn't anything else you can do.

Whether that's in a client-side script that pushes new branches to Stash, or whether that's a plugin in Stash that does it automatically when somone pushes a tag that's up to you. I'm happy to help if you get stuck on this part.

If you're worried/against the idea of putting branches in your normal repository the slight variation would be to mirror your repository and only create the branches in the fork. That means that normal users won't be aware of those extra branches being created, but bamboo can build from them.

I hope that helps.

Charles

PS. While this may seem unrelated, you might want to vote on the following as well. Depending on how this is implemented, if Bamboo supports all refs then that should encompass tags as well:

https://jira.atlassian.com/browse/BAM-11205

Thanks for the information Charles. One followup question: you say "Bamboo doesn't currently have support for anything other than branches." However, you can specify a tag when specifying a new branch in Bamboo, as mentioned in the dialogue "The name of the branch (or tag) containing source code". This being the case, I support I could script up something that adds a new "branch", but is actually basing it on a tag, correct?

Pardon if any of the above doesn't make sense. I'm relatively new to git/stash, and bamboo.

Hi Jeff,

Thanks for the correction. You're quite right that you can build against a tag in a new repository in a plan (which is where that text comes from).

However, the problem lies specfically with "branch builds", which are unfortunately exactly that. You can't automatically detect _new_ tags (or any ref - which can be used for things like pull requests).

So for now, if you want Bamboo to automatically create a 'branch' build against your tags, you will need some form of script.

Cheers,

Charles

This question is about a year old new, so I would like to know if there are any improvements when it comes to handling git tags in Bamboo? Our CI model is built around git tags and thus I need to auto-trigger a build in Bamboo whenever I push an annotated tag to my repository (which is hosted in Stash). Similarly, once a build is triggered this way, I would like for Bamboo to point out that a new tag was the reason for the build. If the workaround "For now you will have to create branches to match your tags." still applies, I would like to have some guidance in how to manage this automatically inside Stash (eg. using plugin), if possible.

+1 can we get an update on this? Branches and tags are just refs in git, so it seems like it should be reasonably easy to trigger on new tags...

+1 Relevant even 6 months later.

+1 Is there any new information about this ?

+1 trigger on tag is really important

+1 would like this feature as well

 

+1


Supporting this would make npm version driven builds much cleaner.

We use tags to help denote the latest version to use. It would be nice to have this tag used as well for deployments.

+1

+1 We also need tag for QA and deployment

0 votes

+1

Suggest an answer

Log in or Join to answer
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,068 views 0 5
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot