git repository - download and build via git tag

Added by Scott Vercuski almost 6 years ago

I have a source code block setup to read from a github source

    <sourcecontrol type="git">
      <repository>git@github.com:myLogin/myBranch.git</repository>
      <branch>mybranch</branch>
      <autoGetSource>true</autoGetSource>
      <fetchSubmodules>true</fetchSubmodules>
      <executable>C:\Program Files (x86)\Git\bin\git.exe</executable>
      <tagOnSuccess>false</tagOnSuccess>
      <commitBuildModifications>false</commitBuildModifications>
      <commitUntrackedFiles>false</commitUntrackedFiles>
      <committerName>John Smith</committerName>
      <committerEMail>john.smith@company.com</committerEMail>
      <timeout>600000</timeout>
    </sourcecontrol>

instead of downloading and building from a branch (mybranch in this case) I'd like to get the source form a particular tag. So if I have a tag v1.2.3 is there a way I can specify that tag instead of a branch?

Thank you for any help,
Scott


Replies (5)

RE: git repository - download and build via git tag - Added by Ruben Willems almost 6 years ago

no, there is no option for that

would not make much sense either I think

tags are symbolic names for a given revision. They always point to the same object (usually: to the same revision); they do not change.
branches are symbolic names for line of development. New commits are created on top of branch. The branch pointer naturally advances, pointing to newer and newer commits.

http://stackoverflow.com/questions/1457103/what-is-the-difference-between-a-tag-and-a-branch-in-git

RE: git repository - download and build via git tag - Added by Scott Vercuski almost 6 years ago

Hi Ruben,

A tag is a marker for a branch at a specific moment in time. My intention was to assign a tag to a particular moment in time of a branch and then allow our QA staff to deploy that "version" of the code.

I appreciate the prompt response !!! thank you !!!

Scott

RE: git repository - download and build via git tag - Added by Zev M almost 6 years ago

With SVN, Tagging and Branching are the same thing. The only difference is how you treat them. They technically both start off as a tag, then if you make any modifications, it's then considered a branch.

RE: git repository - download and build via git tag - Added by Ruben Willems almost 6 years ago

starting to understand the meaning of the question better.

but if the QA people want to compile the code of tag v1.2.3 again, what did they test?
--> I mean : a dev checks in, the build server starts compiling, and creates an install/ copies to test server

why is there a need to re-compile, re-create the package?

if you really need it, you can enter a new issue, and we'll see if we can incorporate it

RE: git repository - download and build via git tag - Added by Jose Marcenaro over 5 years ago

Hi Scott,

We had the same need, and I've coded and proposed a patch (pull request) that you may find here

It adds an optional 'revision' configuration element in the git source control block.

Regards,
Jose

(1-5/5)