Jenkins on Windows 10 with Bash

一笑奈何 提交于 2019-12-21 17:28:05

问题


I'm currently setting up a Jenkins server on Windows 10, in the hope of being able to make the build scripts more cross platform I was hoping to take advantage of the bash environment that is available in Windows 10.

I hoped this could be done just by setting the path to the shell in Jenkins to be the bash executable, however I've encountered some problems with trying to get this to work.

Firstly when I set the path to be C:\Windows\System32\bash.exe but Jenkins didn't seem to be able to see this path.

I assumed this was because Jenkins was running as 32-bit and changed the path to be C:\Windows\sysnative\bash.exe but when I try and use this I get the error

[workspace] $ C:\Windows\sysnative\bash.exe -xe    C:\Users\Jenkins\AppData\Local\Temp\hudson4346151084156392102.sh
Error: 0x80070005


Build step 'Execute shell' marked build as failure

I think I'm poking around in the dark a bit so I didn't know if anyone had any experience of trying to use the bash shell on Windows 10 within Jenkins?


回答1:


You can run this on Windows in order to execute a bash shell script:

bash -c /mnt/c/Users/$LOGNAME/Downloads/abc.sh

Make sure that the script is executable (chmod +x)



来源:https://stackoverflow.com/questions/39351532/jenkins-on-windows-10-with-bash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!