【问题标题】:Jenkins on Windows 10 with Bash使用 Bash 在 Windows 10 上运行 Jenkins
【发布时间】:2017-01-14 01:27:01
【问题描述】:

我目前正在 Windows 10 上设置 Jenkins 服务器,希望能够使构建脚本更加跨平台,我希望利用 Windows 10 中可用的 bash 环境。

我希望这可以通过将 Jenkins 中的 shell 路径设置为 bash 可执行文件来完成,但是我在尝试让它工作时遇到了一些问题。

首先当我将路径设置为C:\Windows\System32\bash.exe 但詹金斯似乎无法看到这条路径。

我认为这是因为 Jenkins 以 32 位运行并将路径更改为 C:\Windows\sysnative\bash.exe,但是当我尝试使用它时出现错误

[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

我想我有点摸不着头脑,所以我不知道是否有人有尝试在 Jenkins 中在 Windows 10 上使用 bash shell 的经验?

【问题讨论】:

    标签: bash jenkins windows-10


    【解决方案1】:

    您可以在 Windows 上运行它以执行 bash shell 脚本:

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

    确保脚本是可执行的 (chmod +x) (仅适用于安装了 linux 子系统的 Windwos 10)

    【讨论】:

      【解决方案2】:

      0x80070005 错误通常在 Windows 更新期间或由特定应用程序出现,因为 .DLL 文件权限被拒绝。查看您的权限,然后重试。

      【讨论】:

        猜你喜欢
        • 2017-06-27
        • 2017-03-29
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-09-15
        • 2015-09-13
        • 2017-02-14
        相关资源
        最近更新 更多