4
votes

Is there any way to make jenkins checkout and build a certain tag (parameterized builds?) I'm currently building the development (master branch) and right after tag a version (using maven:release)

some information (as suggested by Vonc)
Env is win7, latest git, latest jenkins (updated yesterday) . I've tried placing the tag name in the Branch Specifier but without luck (either it fails or checking out the master branch). from jenkins log:

Fetching changes from 1 remote Git repository Fetching upstream changes from [email protected]:${myorgname}/${myorgname}.git

I'm guessing the question is really - where (if any) do I tell jenkins - "hi, don't checkout master branch, just checkout the tag". Is there a place I can configure the git command myself? (e.g - git fetch my_tag)

1
Any error message or other specific details you might share in your question, then? (Including the specifics of your environment, Os, version of Java, Jenkins, and so on)VonC
win7, latest git, latest jenkins (updated yesterday) . jdk7_02 (not sure why it matters..) I've tried placing the tag name in the ` Branch Specifier` but without luck (either it fails or checking out the master branch). from jenkins log italic_Fetching changes from 1 remote Git repository Fetching upstream changes from [email protected]:${ORG_NAME}/${ORG_NAME}.git_italicYoni Moses
interesting. All those details along with the exact copy of any error message you got so far should be in your (edited) question. You will be able to present those information more easily in the question than in a comment.VonC
Have you tried usign something like "refs/tags/mytag" as refspec setting? I think you can only specify branches there but maybe it's worth a try.Paul Voss

1 Answers

2
votes

If you want to make Jenkins build from a git tag, you enter the tag name into the box labeled "Branches to build". You can put a branch name, a tag or even a git revision into the box.

If it is not working for you, are you sure you have pushed the tag to the repository where Jenkins is pulling from? git push does not push tags unless you tell it to.