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

Add a withGit pipeline step that provides git credentials

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • None

      It would be nice if we had a withGit step that would pre-configure the git credentials from the current "scm" object and allows us to invoke git from the command line as follows:

      withGit {
         sh 'git fetch'
      }

      The step would rely on the same GIT_ASKPASS mechanism as used during a "standard" checkout.

       

        1. mktemp.groovy
          0.6 kB
        2. rmdir.groovy
          0.4 kB
        3. utils.groovy
          2 kB
        4. withGit.groovy
          3 kB

          [JENKINS-47733] Add a withGit pipeline step that provides git credentials

          Bertrand Renuart created issue -
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Mark Waite made changes -
          Component/s New: git-plugin [ 15543 ]
          Component/s Original: git-client-plugin [ 17423 ]
          Nick Jones made changes -
          Link New: This issue is related to JENKINS-28335 [ JENKINS-28335 ]
          Bertrand Renuart made changes -
          Attachment New: withGit.groovy [ 43504 ]
          Bertrand Renuart made changes -
          Attachment New: mktemp.groovy [ 43509 ]
          Bertrand Renuart made changes -
          Attachment New: utils.groovy [ 43510 ]
          Bertrand Renuart made changes -
          Attachment New: rmdir.groovy [ 43511 ]
          Mark Waite made changes -
          Summary Original: withGit pipeline step New: Add a withGit pipeline step that provides git credentials
          Mark Waite made changes -
          Link New: This issue duplicates JENKINS-28335 [ JENKINS-28335 ]
          Mark Waite made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]

            Unassigned Unassigned
            brenuart Bertrand Renuart
            Votes:
            9 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated: