I have a Windows 7 and a Windows Server 2012 slave with the Jenkins agent and Cygwin already set up. I want to avoid Cygwin and just use the Git Bash shell that comes with Git for Windows (I think it's called msysgit). So I renamed C:\cygwin64
to C:\cygwin64.bak
, removed C:\cygwin64\bin
from the path, and rebooted.
The Windows 2012 box now works fine, (Unix) shell scripts run, $OSTYPE = msys
, and uname = MSYS_NT-6.3
(indicating that the Git Bash shell is running).
The Windows 7 box won't run anything, and gives the following error:
Building remotely on win7 in workspace C:\Users\Jenkins\workspace\TEST
[win7] $ sh -xe C:\Users\jenkins\AppData\Local\Temp\hudson5047939025129374618.sh
The system cannot find the file specified
FATAL: command execution failed
java.io.IOException: Cannot run program "sh" (in directory "C:\Users\Jenkins\workspace\TEST"): CreateProcess
error=2, The system cannot find the file specified.
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
So my question is, how do I configure Jenkins to use C:\Program Files\Git\bin\sh.exe
, or C:\Program Files\Git\usr\bin\bash.exe
to run shell scripts?
C:\Program Files\Git\bin
also has a sh.exe in it. Any reason not to use that? – Anatomist