I have setup a jenkins server on windows10 pro and installed ubuntu bash on the system. And I created a Executable windows batch command
and put the command bash -c ls
there. When executing this job I got below error:
c:\jenkins\workspaces>bash -c ls
'bash' is not recognized as an internal or external command,
operable program or batch file.
It says that bash
is not recognized as an internal or external command. Then I tried to use the absolute path but still not work. The error is shown as below:
c:\jenkins\workspaces>C:\Windows\System32\bash.exe -c ls
'C:\Windows\System32\bash.exe' is not recognized as an internal or external command,
operable program or batch file.
I can run the command manually on windows. How can I configure this on jenkins? I need to run the build command from windows normal command window and in my build script it needs to launch a process inside bash.
To access the shell, simply type 'bash' in the Windows command prompt, and everything is good to go.
With the arrival of Windows 10's Bash shell, you can now create and run Bash shell scripts on Windows 10. You can also incorporate Bash commands into a Windows batch file or PowerShell script.
You could install MsysGit, which includes bash, and in Jenkins you have to set the shell executable, which is the path to the sh.exe
You could also install cygwin, but i think this uses high amount of RAM for just running bash scripts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With