I have Windows 7 and a slave Windows Server 2012 with a Jenkins agent, and Cygwin is already configured. 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:\cygwin64to C:\cygwin64.bak, removed C:\cygwin64\binfrom the path and rebooted.
Windows 2012 is now working fine, (Unix) shell scripts run, $OSTYPE = msysand uname = MSYS_NT-6.3(indicating that the Git Bash shell is working).
In the Windows 7 window, nothing will start and the following error appears:
Creating remotely on win7 in the workspace C: \ Users \ Jenkins \ workspace \ TEST
[win7] $ sh -xe C: \ Users \ jenkins \ AppData \ Local \ Temp \ hudson5047939025129374618.sh
The system cannot find the specified file. FATAL: command execution failed
java.io.IOException: cannot start the program "sh" (in the directory "C: \ Users \ Jenkins \ workspace \ TEST"): CreateProcess
error = 2, the system cannot find the specified file.
in java.lang.ProcessBuilder.start (ProcessBuilder.java:1041)
So my question is: how do I configure Jenkins to use C:\Program Files\Git\bin\sh.exeor C:\Program Files\Git\usr\bin\bash.exeto run shell scripts?
source
share