Change Windows shell in Jenkins (from Cygwin to Git Bash/msys) -


i have windows 7 , windows server 2012 slave jenkins agent , cygwin set up. want avoid cygwin , use git bash shell comes git windows (i think it's called msysgit). renamed c:\cygwin64 c:\cygwin64.bak, removed c:\cygwin64\bin path, , rebooted.

the windows 2012 box works fine, (unix) shell scripts run, $ostype = msys, , uname = msys_nt-6.3 (indicating git bash shell running).

the windows 7 box won't run anything, , gives following error:

building remotely on win7 in workspace c:\users\jenkins\workspace\test
[win7] $ sh -xe c:\users\jenkins\appdata\local\temp\hudson5047939025129374618.sh
system cannot find file specified
fatal: command execution failed
java.io.ioexception: cannot run program "sh" (in directory "c:\users\jenkins\workspace\test"): createprocess
error=2, system cannot find file specified.
       @ java.lang.processbuilder.start(processbuilder.java:1041)

so question is, how configure jenkins use c:\program files\git\bin\sh.exe, or c:\program files\git\usr\bin\bash.exe run shell scripts?

i've worked out. jenkins pick first sh.exe in path. git bash has exe @ c:\program files\git\usr\bin, if add beginning of path picked jenkins.

you have restart slave's connection jenkins after making change, otherwise path won't propagate. if you're using java web start, close java window , relaunch it.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -