Cygwin Cruisecontrol 无法执行命令

发布于 2024-07-26 16:07:49 字数 1265 浏览 3 评论 0原文

我遇到了我希望是一个简单的问题。 然而,它却让我困惑了一整天。

我正在 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 技术交流群。

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

发布评论

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

评论(1

清风夜微凉 2024-08-02 16:07:49

回复:GrzegorzOledzki 的评论:

正确,但你给了我一个最终对此有所帮助的想法,尽管它远非理想的解决方案。

我注意到所有失败的命令都使用路径,而有效的命令则没有。 考虑到这一点,我又尝试了一些事情。

有效的事情:

<exec command="touch" workingdir="projects" args="ABC.txt"/>
<exec command="svn" args="cleanup" workingdir="${svndir}/Iosdll"/>

这些路径必须是相对的而不是绝对的仅供参考:(

仍然无效的事情:

尝试使用它来运行我的脚本
格式(同样的错误)

尝试运行不支持的脚本
存在(同样的错误!!!)

执行多个exec命令...
就像一个自上而下的程序(只运行
第一)

显然,这个 ExecScript IO 异常是某种通用的无法运行命令错误。 乱搞 command="path/script" 或 command="script"workingdir="path" 没有产生任何结果。 所以我只是进入 /etc/profile (相当于 cygwin 的 bash_profile)并将脚本的路径添加到 PATH 中。 现在这种工作有效了。

<exec command="IOSdllScript.bat"/>

编辑:在使用 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:

<exec command="touch" workingdir="projects" args="ABC.txt"/>
<exec command="svn" args="cleanup" workingdir="${svndir}/Iosdll"/>

These paths have to be relative not absolute fyi :(

Things that still didn't work:

Trying to run my script using this
format (Same error)

Trying to run a script that doesn't
exist (Same error!!!)

Executing multiple exec command...
like a top down program (only runs
first)

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.

<exec command="IOSdllScript.bat"/>

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.

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