使用 msysGit shell 的 Hudson 从站

发布于 2024-11-10 10:40:00 字数 317 浏览 4 评论 0原文

我在 Windows 机器上有一个 Hudson Slave,需要在其上执行一些 shell 命令。我已将所有命令放入项目的执行 shell 部分,第一行如下所示:

#!C:\msysgit\msysgit\bin\sh.exe

但是,在运行项目时,我收到错误消息,提示找不到命令。特别是对于 git、cd、make、rm,我会假设更多。我觉得这是一个很容易解决的问题,但无法弄清楚。在机器上使用 msysGit 时,该脚本工作正常,但我在通过 Hudson 执行此操作时遇到问题。任何帮助将不胜感激。我需要使用 msysGit 而不是 Cygwin。

I have got a Hudson Slave on a windows machine and need to execute some shell commands on it. I have put all the commands in the execute shell portion of the project and the first line reads as this:

#!C:\msysgit\msysgit\bin\sh.exe

However when running the project I am getting errors saying command not found. Specifically for git, cd, make, rm and I would presume more. I feel like this is a simple thing to fix but can't figure it out. The script works fine when using msysGit on the machine but I am having trouble doing it through Hudson. Any help would be appreciated. I need to be using msysGit not Cygwin.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

被你宠の有点坏 2024-11-17 10:40:00

您可以首先让该脚本显示:

并查看这些变量在 Hudson 作业上下文中引用的内容。
它们可能不会反映/继承您当前会话的值。
它可能取决于 您如何安装 msysgit


OP Zack Lalanne 在评论中提到他只需要:

 #!C:\msysgit\bin\sh.exe --login -i

这意味着 bash 会话将继承他的环境变量,使得作业比没有用户环境时更有可能运行。

You could start by making that script displays:

And see what those variables reference in the context of an Hudson job.
They might not reflect/inherit the values of your current session.
And it can depend on how you did install msysgit.


The OP Zack Lalanne mentions in the comment he just need to have:

 #!C:\msysgit\bin\sh.exe --login -i

which means the bash session will inherit his environment variables, making the job much likely to run than without the user's environment.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文