巡航控制nant 参数未传递

发布于 2024-08-19 10:27:18 字数 1719 浏览 9 评论 0原文

我一直在尝试使用 Cruisecontrol 构建配置文件中的参数,但无济于事。检查 Cruisecontrol 日志文件时,我尝试传递的任何构建参数都不会传递到对 nAnt 的调用。

这是 nant 任务:

<nant>
  <buildArgs>-D:CCFoo="Unknown" -D:foo="$(foo)"</buildArgs>
  <executable>C:\MCR\Trunk\BuildLibrary\NAnt.exe</executable>
  <baseDirectory>C:\MCR\Trunk\tek.Build</baseDirectory>
  <buildFile>tek.build</buildFile>
  <targetList>
    <target>cc</target>
  </targetList>
  <buildTimeoutSeconds>1800</buildTimeoutSeconds>
</nant>

这是调用 nant 的日志文件中显示的内容:

2010-01-28 08:45:12,815 [TekWebsite:DEBUG] Starting process [C:\MCR\Trunk\BuildLibrary\NAnt.exe] in working directory [C:\MCR\Trunk\tek.Build] with arguments [-nologo -buildfile:tek.build -logger:NAnt.Core.XmlLogger -D:CCNetArtifactDirectory="C:\Program Files (x86)\CruiseControl.NET\server\builds" -D:CCNetBuildCondition=ForceBuild -D:CCNetBuildDate=2010-01-28 -D:CCNetBuildTime=08:45:12 -D:CCNetFailureUsers= -D:CCNetIntegrationStatus=Unknown -D:CCNetLabel=50 -D:CCNetLastIntegrationStatus=Failure -D:CCNetListenerFile="C:\Program Files (x86)\CruiseControl.NET\server\builds\ClarksWebsite_ListenFile.xml" -D:CCNetModifyingUsers= -D:CCNetNumericLabel=50 -D:CCNetProject=TekWebsite -D:CCNetProjectUrl=http://cor-str-mcr08/ccnet/server/local/project/TekWebsite/ViewProjectReport.aspx -D:CCNetRequestSource=Dashboard -D:CCNetWorkingDirectory="C:\Program Files (x86)\CruiseControl.NET\server" cc]

我在想是否 Cruisecontrol 有一个配置设置告诉它忽略 buildargs?

我尝试重新排序 nant 任务中的行,如您所见,将 buildargs 放在顶部,并将一些位置放在中间和底部。我尝试了可用于 buildargs 的不同语法,例如:

-D:CCFoo="Unknown" -D:CCFoo=未知 -DCCFoo=未知

I've been trying to use the param in my cruisecontrol build config file to no avail. When checking the cruisecontrol log file, whatever buildargs I try to pass are NOT passed to the call to nAnt.

Here's the nant task:

<nant>
  <buildArgs>-D:CCFoo="Unknown" -D:foo="$(foo)"</buildArgs>
  <executable>C:\MCR\Trunk\BuildLibrary\NAnt.exe</executable>
  <baseDirectory>C:\MCR\Trunk\tek.Build</baseDirectory>
  <buildFile>tek.build</buildFile>
  <targetList>
    <target>cc</target>
  </targetList>
  <buildTimeoutSeconds>1800</buildTimeoutSeconds>
</nant>

Here's what appears in the logfile for that call to nant:

2010-01-28 08:45:12,815 [TekWebsite:DEBUG] Starting process [C:\MCR\Trunk\BuildLibrary\NAnt.exe] in working directory [C:\MCR\Trunk\tek.Build] with arguments [-nologo -buildfile:tek.build -logger:NAnt.Core.XmlLogger -D:CCNetArtifactDirectory="C:\Program Files (x86)\CruiseControl.NET\server\builds" -D:CCNetBuildCondition=ForceBuild -D:CCNetBuildDate=2010-01-28 -D:CCNetBuildTime=08:45:12 -D:CCNetFailureUsers= -D:CCNetIntegrationStatus=Unknown -D:CCNetLabel=50 -D:CCNetLastIntegrationStatus=Failure -D:CCNetListenerFile="C:\Program Files (x86)\CruiseControl.NET\server\builds\ClarksWebsite_ListenFile.xml" -D:CCNetModifyingUsers= -D:CCNetNumericLabel=50 -D:CCNetProject=TekWebsite -D:CCNetProjectUrl=http://cor-str-mcr08/ccnet/server/local/project/TekWebsite/ViewProjectReport.aspx -D:CCNetRequestSource=Dashboard -D:CCNetWorkingDirectory="C:\Program Files (x86)\CruiseControl.NET\server" cc]

I'm thinking that maybe there's a config setting for cruisecontrol that tells it to ignore buildargs?

I've tried reordering the lines in the nant task, putting buildargs at the top as you see, and a few places in the middle and the bottom. I've tried the different syntaxes that are available for buildargs such as:

-D:CCFoo="Unknown"
-D:CCFoo=Unknown
-DCCFoo=Unknown

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

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

发布评论

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

评论(2

ゝ杯具 2024-08-26 10:27:18

我发现了这一点 - ccnet 守护进程使用的 ccnet.config 文件不会重新加载构建配置文件,直到:

a) 进程重新启动或
b) ccnet.config 文件以某种方式被更改或修改。

所以我只是进入 C:\Program Files (x86)\CruiseControl.NET\server.ccnet.config 并添加一个空格,保存,现在 buildargs 正在传递给 nant。哇哦!

I figured this out - the ccnet.config file that's used by the ccnet daemon process won't reload the build config file until either:

a) the process is restarted OR
b) the ccnet.config file is altered or touched in some way.

So I just went into C:\Program Files (x86)\CruiseControl.NET\server.ccnet.config and added a space, saved and now the buildargs are being passed to nant. woohoo!

想你的星星会说话 2024-08-26 10:27:18

我在运行一些bat文件时遇到了完全相同的问题,但我的原因是我使用了:

<msbuild>
  ...

而不是

<exec>
  ...

I had the exact same problem running some bat file but my reason was I has used:

<msbuild>
  ...

instead of

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