Cygwin Cruisecontrol 无法执行命令
我遇到了我希望是一个简单的问题。 然而,它却让我困惑了一整天。
我正在 Windows 中使用 Cruisecontrol,通过 Cygwin 设置。 我在 Linux 平台上有一些 CC 经验,并且我正在做的很多事情都非常相似。 但是,我尝试在 config.xml 文件的 Schedule 部分中执行的大多数命令都会出错。
例外情况如下:
ExecBuilder - Could not execute command: /cygdrive/d/Program\ Files/Subversion/bin/svn
net.sourceforge.cruisecontrol.CruiseControlException: Encountered an IO exception while attempting to execute 'net.sourceforge.cruisecontrol.builders.ExecScript@b80f1c'. CruiseControl cannot continue.
at net.sourceforge.cruisecontrol.builders.ScriptRunner.runScript(ScriptRunner.java:133)
以下是我尝试运行的一些命令示例,这些命令给出了此类错误。
<exec command="${CCLoc}/projects/${project.name}/IOSdllScript"/>
-运行我在 Cruisecontrol.bat 之外测试的脚本并运行。 包括 #!/bin/sh 作为第一行
<exec command="${CCLoc}/projects/${project.name}/EmptyFile"/>
- 本质上是一个空文本文件,证明问题与我的脚本无关。
<exec command="/cygdrive/d/Program\ Files/Subversion/bin/svn" args="cleanup" workingdir="${svndir}"/>
-尝试对目录进行 svn 清理。 我仔细检查了路径和拼写。
我测试过的一个命令有效并且没有给出此错误。 这个命令就是触摸。
<exec command="touch" args="ABC.txt"/>
我不知道为什么似乎只有触摸才有效,而其他都不起作用。
I'm having what I hope to be a simple problem. However, it's had me stumped all day.
I'm working with cruisecontrol in windows, being set up through Cygwin. I have some CC experience in the linux platform and much of what I'm doing is very similar. However, most any command I try to execute in the config.xml file's Schedule section is giving an error.
Here's the exception:
ExecBuilder - Could not execute command: /cygdrive/d/Program\ Files/Subversion/bin/svn
net.sourceforge.cruisecontrol.CruiseControlException: Encountered an IO exception while attempting to execute 'net.sourceforge.cruisecontrol.builders.ExecScript@b80f1c'. CruiseControl cannot continue.
at net.sourceforge.cruisecontrol.builders.ScriptRunner.runScript(ScriptRunner.java:133)
Here are some examples of commands I've tried to run which give this type of error.
<exec command="${CCLoc}/projects/${project.name}/IOSdllScript"/>
-Runs a script that I tested outside of the cruisecontrol.bat and it runs. Includes #!/bin/sh as the first line
<exec command="${CCLoc}/projects/${project.name}/EmptyFile"/>
-Essentially an empty text file, proving that the problem had nothing to do with my script.
<exec command="/cygdrive/d/Program\ Files/Subversion/bin/svn" args="cleanup" workingdir="${svndir}"/>
-Trys svn cleanup on a directory. I double checked the pathing and spelling.
One command that I tested worked and didn't give this error. That command was touch.
<exec command="touch" args="ABC.txt"/>
I'm not sure why only touch seems to work and nothing else does.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
回复:GrzegorzOledzki 的评论:
正确,但你给了我一个最终对此有所帮助的想法,尽管它远非理想的解决方案。
我注意到所有失败的命令都使用路径,而有效的命令则没有。 考虑到这一点,我又尝试了一些事情。
有效的事情:
这些路径必须是相对的而不是绝对的仅供参考:(
仍然无效的事情:
显然,这个 ExecScript IO 异常是某种通用的无法运行命令错误。 乱搞 command="path/script" 或 command="script"workingdir="path" 没有产生任何结果。 所以我只是进入 /etc/profile (相当于 cygwin 的 bash_profile)并将脚本的路径添加到 PATH 中。 现在这种工作有效了。
编辑:在使用 Cygwin 时,作为批处理文件似乎比脚本更好。
我仍然想知道如何以“正确”的方式执行此操作,即 IE,而无需更改 cygwin 的 PATH 变量。
Re: GrzegorzOledzki's comment:
Correct, but you gave me an idea which ended up helping this, though its far from the ideal solution.
I noticed that all of the commands that fail use paths and the command that works didn't. I tried a few more things with this in mind.
Things that work:
These paths have to be relative not absolute fyi :(
Things that still didn't work:
Apparently, this ExecScript IO exception is some kind of generic cannot run the command error. Messing around with command="path/script" or command="script" workingdir="path" yielded no results. So I just went into /etc/profile (cygwin's bash_profile equivalent) and added the path to my script to PATH. Now this sort of works.
Edit: Seems to work better as a batch file than a script when going through Cygwin.
I still would like to know how to do this the "right" way, IE without having to change cygwin's PATH variable.