如何使用CruiseControlNet将集成属性传递到批处理文件? [英] How to pass an integration property to a batch file with CruiseControlNet?

查看:152
本文介绍了如何使用CruiseControlNet将集成属性传递到批处理文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目的构建日志中,我可以看到以下属性:

  integrationProperties> 
< CCNetProject> Gdet_T< / CCNetProject>
...
< LastModificationDate> 4/6/2010 1:29:04 PM< / LastModificationDate>
< LastChangeNumber> 10841< / LastChangeNumber>
< / integrationProperties>

我想传递属性 CCNetProject LastChangeNumber 添加到批处理文件。 它可以与 CCNetProject 配合使用,因为它可以在批处理中用作环境变量%CCNetProject%



但不适用于其他属性(这些不是以 CCnet 前缀)为 LastChangeNumber LastModificationDate



我试图传递它作为参数,但它失败了!

 < exec& 
<可执行文件> $(WorkingFolderBase)\MyBatch.bat< / executable>
< baseDirectory> $(WorkingFolderBase)\< / baseDirectory>
< buildArgs> $(LastModificationDate)< / buildArgs>
< / exec>

我尝试将其作为环境变量传递,但失败:

 < exec> 
<可执行文件> $(WorkingFolderBase)\MyBatch.bat< / executable>
< baseDirectory> $(WorkingFolderBase)\< / baseDirectory>
< environment>
< variable>
< name> svn_label< / name>
< value>$ {LastModificationDate}< / value>
< / variable>
< / environment>
< / exec>

显示参数或变量时,结果总是相同:空字符串或变量名称 $(svn_label)



我确定它很简单,但...我找不到!任何想法?

解决方案

ok,找到了解决方案。
需要使用名为 SvnRevisionLabeller 的特定标签来检索svn修订版本。
,然后通过 CCNetLabel 环境变量可用。



http://code.google.com/p/svnrevisionlabeller/

 < labeller type =svnRevisionLabeller> 
< url> http:// mysvnrootproject / trunk< / url>
< / labeller>


In the build log of my project, i can see these properties:

<integrationProperties>
  <CCNetProject>Gdet_T</CCNetProject>
  ...
  <LastModificationDate>4/6/2010 1:29:04 PM</LastModificationDate>
  <LastChangeNumber>10841</LastChangeNumber>
</integrationProperties>

I want to pass the property CCNetProject and LastChangeNumber to a batch file. it works well with CCNetProject, as it can be used in the batch as an environment variable %CCNetProject%.

But it doesn't work with other properties (those are not starting with the CCnet prefix) as LastChangeNumber or LastModificationDate.

I tried to pass it as argument, but it fails !

<exec>
  <executable>$(WorkingFolderBase)\MyBatch.bat</executable>
  <baseDirectory>$(WorkingFolderBase)\</baseDirectory>
  <buildArgs>$(LastModificationDate)</buildArgs>
</exec>

I tried to pass it as environment variable, but it fails:

<exec>
  <executable>$(WorkingFolderBase)\MyBatch.bat</executable>
  <baseDirectory>$(WorkingFolderBase)\</baseDirectory>
  <environment>
    <variable>
      <name>svn_label</name>
      <value>"${LastModificationDate}"</value>
    </variable>
  </environment>
</exec>

The results is always the same when I display the parameter or variable : empty string or the variable name $(svn_label)

I'm sure it is simple, but ... I can't find ! Any idea ?

解决方案

ok, found the solution. Need to use a specific label called SvnRevisionLabeller to retrieve the svn revision. it is then available via the CCNetLabel environement variable.

http://code.google.com/p/svnrevisionlabeller/

<labeller type="svnRevisionLabeller"> 
  <url>http://mysvnrootproject/trunk</url> 
</labeller>

这篇关于如何使用CruiseControlNet将集成属性传递到批处理文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆