Tuesday, May 14, 2013

Jenkins Build Latest Git Tag

We have a Jenkins job that we want to automatically build the latest tag in a git repository. Turns out this is quite doable right out of the box!

Step One:
Use tags with a slash '/'. This helps you target builds for just one set of tags. ex: muyw/4.0.11.11

Step Two:
Specify a Refspec in the Jenkin's git plugin that only selects these tags: +refs/tags/myuw/*:refs/remotes/uw/tags/myuw/*

Step Three:
Specify a Branch Specifier to build these tags: */tags/myuw/*




No comments: