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

Cannot push to mapped Windows Git repo in Jenkins

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • cygpath-plugin, git-plugin
    • None
    • Windows 7 .NET build box pushing to Windows 2008 R2 server via mapped drive using Cygwin in Jenkins

      I have a Windows7 box that does our CI build and I need it to push a new branch to a mapped Git repo via file://. Basically, if I run the same commands in a Git Bash or Cygwin console, they work fine. Running through Jenkins, I'm getting an error with an pre-pended C:\Program Files pre-pended path in the git push statement. Here's the Jenkins Shell code:

      #!/bin/bash
      cd ../GIT_REPO
      git add -A
      git commit -m "Updated CI build for version $BUILD_VERSION_NUMBER_NEW based on $ACCUREVCOMMENT. This build was triggered by $BUILD_CAUSE"
      git branch "RC_$BUILD_VERSION_NUMBER_NEW"
      git push -v file:///cygdrive/g/repo.git "RC_6.0"
      git push -v file:///cygdrive/g/repo.git "RC_$BUILD_VERSION_NUMBER_NEW"

      The output looks like this:

      Pushing to file:///cygdrive/g/repo.git
      fatal: 'C:/Program Files/Git/cygdrive/g/repo.git' does not appear to be a git repository
      fatal: The remote end hung up unexpectedly
      Pushing to file:///cygdrive/g/repo.git
      fatal: 'C:/Program Files/Git/cygdrive/g/repo.git' does not appear to be a git repository
      fatal: The remote end hung up unexpectedly

      Now, I've tried several iterations of the file:// string including using g:, etc. I've also tried to switch the version of shell in Manage Jenkins from cygwin to Git Bash to no effect. Please help. I need to be able to push via mapped drive to this particular Windows server.

      Please help!

            ndeloof Nicolas De Loof
            agallant Andrew Gallant
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: