I created a Pipeline project to build a Git project based on it's tag.

      node {
      git branch: 'refs/tags/VMAccess-1.4.1.0', url: 'https://github.com/azure/azure-linux-extensions'
      }

      The console output contains the following data.

      > git rev-parse refs/remotes/origin/refs/tags/VMAccess-1.4.1.0^

      {commit} # timeout=10
      > git rev-parse refs/remotes/origin/origin/refs/tags/VMAccess-1.4.1.0^{commit}

      # timeout=10
      > git rev-parse origin/refs/tags/VMAccess-1.4.1.0^

      {commit} # timeout=10

      The correct rev-parse should be refs/tags/VMAccess-1.4.1.0, but that value is never tried by the plugin. (The value refs/remotes/origin/refs/tags/VMAccess-1.4.1.0 may also be valid.) I tried to influence the refspec, but setting the refspec key in the git command, but this had no effect.

      I create a Freestyle project, and set the branch to refs/tags/VMAccess-1.4.1.0. The project built successfully.

      The console output contains the following data.

      > git rev-parse refs/tags/VMAccess-1.4.1.0^{commit}

      # timeout=10
      > git rev-parse refs/remotes/origin/refs/tags/VMAccess-1.4.1.0^

      {commit}

      # timeout=10
      Checking out Revision 97fb7b019946ef71f15e73881b761e4ba1933781 (refs/tags/VMAccess-1.4.1.0)

          [JENKINS-37050] Pipeline Job Cannot Checkout Git Tag

          Christopher Boumenot created issue -
          Christopher Boumenot made changes -
          Description Original: I created a Pipeline project to build a Git project based on it's tag.

          node {
              git branch: 'refs/tags/VMAccess-1.4.1.0', url: 'https://github.com/azure/azure-linux-extensions'
          }

          The console output contains the following data.

           > git rev-parse refs/remotes/origin/refs/tags/VMAccess-1.4.1.0^{commit} # timeout=10
           > git rev-parse refs/remotes/origin/origin/refs/tags/VMAccess-1.4.1.0^{commit} # timeout=10
           > git rev-parse origin/refs/tags/VMAccess-1.4.1.0^{commit} # timeout=10

          The correct rev-parse should be refs/tags/VMAccess-1.4.1.0, but that value is never tried by the plugin. (The value refs/remotes/origin/refs/tags/VMAccess-1.4.1.0 may also be valid.) I tried to influence the refspec, but setting the refspec key in the git command, but this had no effect.

          I create a Freestyle project, and set the branch to refs/tags/VMAccess-1.4.1.0. The project build successfully.

          The console output contains the following data.

           > git rev-parse refs/tags/VMAccess-1.4.1.0^{commit} # timeout=10
           > git rev-parse refs/remotes/origin/refs/tags/VMAccess-1.4.1.0^{commit} # timeout=10
          Checking out Revision 97fb7b019946ef71f15e73881b761e4ba1933781 (refs/tags/VMAccess-1.4.1.0)

          New: I created a Pipeline project to build a Git project based on it's tag.

          node {
              git branch: 'refs/tags/VMAccess-1.4.1.0', url: 'https://github.com/azure/azure-linux-extensions'
          }

          The console output contains the following data.

           > git rev-parse refs/remotes/origin/refs/tags/VMAccess-1.4.1.0^{commit} # timeout=10
           > git rev-parse refs/remotes/origin/origin/refs/tags/VMAccess-1.4.1.0^{commit} # timeout=10
           > git rev-parse origin/refs/tags/VMAccess-1.4.1.0^{commit} # timeout=10

          The correct rev-parse should be refs/tags/VMAccess-1.4.1.0, but that value is never tried by the plugin. (The value refs/remotes/origin/refs/tags/VMAccess-1.4.1.0 may also be valid.) I tried to influence the refspec, but setting the refspec key in the git command, but this had no effect.

          I create a Freestyle project, and set the branch to refs/tags/VMAccess-1.4.1.0. The project built successfully.

          The console output contains the following data.

           > git rev-parse refs/tags/VMAccess-1.4.1.0^{commit} # timeout=10
           > git rev-parse refs/remotes/origin/refs/tags/VMAccess-1.4.1.0^{commit} # timeout=10
          Checking out Revision 97fb7b019946ef71f15e73881b761e4ba1933781 (refs/tags/VMAccess-1.4.1.0)

          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]

          Brad M added a comment -

          This is a show-stopper for us before switching to pipeline builds for our packaging. In this case the plugin's parameter 'branch' is a bit limiting

          Brad M added a comment - This is a show-stopper for us before switching to pipeline builds for our packaging. In this case the plugin's parameter 'branch' is a bit limiting
          Brad M made changes -
          Priority Original: Minor [ 4 ] New: Major [ 3 ]
          Andrew Bayer made changes -
          Labels Original: git pipeline tags workflow New: git pipeline tags
          Michael Neale made changes -
          Remote Link New: This issue links to "cb details (Web Link)" [ 17305 ]
          Michael Neale made changes -
          Labels Original: git pipeline tags New: cloudbees-internal-pipeline git pipeline tags
          Michael Neale made changes -
          Component/s New: pipeline [ 21692 ]
          Michael Neale made changes -
          Link New: This issue relates to JENKINS-34395 [ JENKINS-34395 ]

            Unassigned Unassigned
            boumenot Christopher Boumenot
            Votes:
            9 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated:
              Resolved: