使用 msysGit shell 的 Hudson 从站
我在 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技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以首先让该脚本显示:
$HOME
(对于 ssh 操作很重要,以及 在 Windows 上并不总是正确设置)并查看这些变量在 Hudson 作业上下文中引用的内容。
它们可能不会反映/继承您当前会话的值。
它可能取决于 您如何安装 msysgit 。
OP Zack Lalanne 在评论中提到他只需要:
这意味着 bash 会话将继承他的环境变量,使得作业比没有用户环境时更有可能运行。
You could start by making that script displays:
$HOME
(important for ssh operation, and not always set correctly on Windows)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:
which means the bash session will inherit his environment variables, making the job much likely to run than without the user's environment.