Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins "tag" build with git

Tags:

git

jenkins

There is an option on jenkins when using git to "tag" the build.

What does this do and how do I use it? I assume I can tag the build at that version but I'm struggling to figure out how to push that tag - it's not so useful unless I can push the tag.

like image 372
Michael Wiles Avatar asked Sep 07 '25 17:09

Michael Wiles


1 Answers

You don't always want to push all the build tags, because there could be a lot of them, depending on your build cycle.

But any task scheduler (like Jenkins) will tag a build in case you want to get back to that specific code and debug it (because even though the build might have succeeded, the end result might have run poorly)

That said, should you want to push those tags, you can use, as mentioned in "Tagging a GitHub project through Jenkins", a post-build action (git push --tags).
Or, as mentioned in the ticket JENKINS-12156, use the GitPublisher (as illustrated in "Git, Feature Branches, and Jenkins – or how I learned to stop worrying about broken builds").

like image 111
VonC Avatar answered Sep 10 '25 15:09

VonC