How to pass an integration property to a batch file with CruiseControlNet?

放肆的年华 提交于 2019-12-03 15:27:04
The Chairman

CCNET passes the following parameters to external programs:

CCNetArtifactDirectory 
CCNetBuildCondition 
CCNetBuildDate 
CCNetBuildTime 
CCNetFailureUsers 
CCNetIntegrationStatus 
CCNetLabel 
CCNetLastIntegrationStatus 
CCNetListenerFile 
CCNetModifyingUsers 
CCNetNumericLabel 
CCNetProject 
CCNetProjectUrl 
CCNetRequestSource 
CCNetUser 
CCNetWorkingDirectory 

As you can see LastIntegrationStatus e.g. is available through CCNetLastIntegrationStatus but LastModificationDate e.g. has no equivalent.

You can pass additional arguments via <buildArgs> or <environment> but inside CCNET configuration you have no access on the integration properties mentioned above. Most people starting with CCNET (including myself) try something like <buildArgs>$(CCNetProject)</buildArgs> and fail.

Have a look on my answer to a similar question.

Sorry I can't provide a better solution.

Update (regarding Thinker's suggestion):

Using $[$CCNetLabel] inside CCNET configuration does not seem to work.

Frankly spoken, I would have been rather surprised, if it had. The configuration is something static whereas CCNetLabel is something dynamic, that potentially changes with every integration build. Assuming you have access to these dynamic properties inside the configuration, the configuration might change with every build. Since changing the configuration means restarting the CCNET server automatically, you would cause a server restart with every build. Not actually a desirable behavior, is it?

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>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!