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

后端 未结 3 470
既然无缘
既然无缘 2021-02-05 22:12

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 f

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-05 22:50

    Install git-bash

    Ensure the Git\bin folder (i.e.: C:\Program Files\Git\bin) is in the global search path, in order for Jenkins to find sh.exe

    to update path in windows use following command

    setx path "%path%;C:\Program Files\Git\bin"

    or have a look here https://www.windows-commandline.com/set-path-command-line/

    to make nohup available for Jenkins

    • mklink "C:\Program Files\Git\bin\nohup.exe" "C:\Program Files\git\usr\bin\nohup.exe"

    • mklink "C:\Program Files\Git\bin\msys-2.0.dll" "C:\Program Files\git\usr\bin\msys-2.0.dll"

    • mklink "C:\Program Files\Git\bin\msys-iconv-2.dll" "C:\Program Files\git\usr\bin\msys-iconv-2.dll"

    • mklink "C:\Program Files\Git\bin\msys-intl-8.dll" "C:\Program Files\git\usr\bin\msys-intl-8.dll"

    That's it now you can run shell commands

    Have fun

提交回复
热议问题