Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-47433

CLI git clone of specific tag fails in pipeline

XMLWordPrintable

      When cloning a project with the git plugin and asking it to fetch a specific tag instead of the master branch, it fails under the recommended setup of specifying the complete branch:

       

      For example, when checking out the following repository using pipeline

      }}{{git branch: 'refs/tags/v3.8', url: 'https://github.com/cpputest/cpputest.git'

       

      This causes the output of

       

      > git fetch --tags --progress

      https://github.com/cpputest/cpputest.git

      {{ +refs/heads/:refs/remotes/origin/ > git rev-parse refs/remotes/origin/v3.8^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/v3.8^{commit} # timeout=10 > git rev-parse origin/v3.8^{commit} # timeout=10 [Pipeline] } [Pipeline] // dir [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.}}

       

      This can be mitigated by using the direct SCM checkout step, and specifying a complete fetch for tags, by setting the refspec to "+refs/tags/:refs/tags/" and setting the branch to "v3.8" instead of "refs/tags/v3.8"

       

      Unfortunately, the recommended setup in the "?" section of the branch suggests that refs/tags/v3.8 should be used.

            Unassigned Unassigned
            jekeller Jacob Keller
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: