Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Can Bamboo create a Git tag for every build?

I would like for bamboo to tag every build before it starts. It looks like you can create a tag for SVN, but not for Git? I found this answer https://answers.atlassian.com/questions/28228/bamboo-vcs-tagging-for-git, which is almost a year old now.

Are there any updates on this feature?

5 answers

I'm really surprised that this feature is not available in an on-demand plugin. This stuff works out of the box for Jenkins/Hudson.

So within the build-dir, I try the following (to simulate a script task):

git tag -a test -m 'Build test'
git push --tags
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>

So:

git push origin test
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I don't want to muck with what bamboo is doing with git, so am I safe to get this working via command line and it will continue to work on future builds?

i.e.

git remote add origin url

I wouldn't recommend messing around with "origin".  Why not simply create a new remote ("origin2" ?) especially for your Bamboo builds?  E.g.:

TAG_NAME=${BRANCH_NAME}-${bamboo_buildNumber}
git tag -f -a ${TAG_NAME} -m 'Tagged by Bamboo'
git remote add origin2 ${bamboo_planRepository_1_repositoryUrl}
git push origin2 ${TAG_NAME}
git ls-remote --exit-code --tags origin2 ${TAG_NAME}

I added in that last command to verify that the tag was actually created.

Got this error with above solution.

 

error 20-Aug-2018 01:20:06 Repository not found
error 20-Aug-2018 01:20:06 The requested repository does not exist, or you do not have permission to access it.
error 20-Aug-2018 01:20:06 fatal: Could not read from remote repository.
error 20-Aug-2018 01:20:06 
error 20-Aug-2018 01:20:06 Please make sure you have the correct access rights
error 20-Aug-2018 01:20:06 and the repository exists.

i'm interested in doing same from deployment tasks.

and i'm also disappointed with the absebce of remotes in bamboos git repos.

how to workaround that? we have a dozen of repos and i'm not quite happy adding remotes to each of them

I'm using Stash, so my approach is to use Stash's REST API to create tags:

https://developer.atlassian.com/static/rest/stash/3.8.0/stash-scm-git-rest.html

using stash api is a good idea

Hi John,

No updates on that feature however it is possible to work around this by adding a Script task that creates a git tag and pushes it remotely using the native git executable.

Thanks
James

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

227 views 4 6
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you