min*_*nty 21 cruisecontrol.net ccnet-config
调用MSBuild巡航控件等外部进程时设置环境变量.其中一个值是CCNetLabel.它保留了当前项目标签的价值.我想在ccnet配置本身使用相同的值但是当我尝试ccnet配置有问题时.我收到以下错误:
[CCNet Server:ERROR] INTERNAL ERROR: Reference to unknown symbol CCNetLabel
----------
ThoughtWorks.CruiseControl.Core.Config.Preprocessor.EvaluationException: Reference to unknown symbol CCNetLabel
at ThoughtWorks.CruiseControl.Core.Config.Preprocessor.ConfigPreprocessorEnvironment._GetConstantDef(String name)
at ThoughtWorks.CruiseControl.Core.Config.Preprocessor.ConfigPreprocessorEnvironment.eval_text_constant(String name)
.....
----------
Run Code Online (Sandbox Code Playgroud)
我实际上想将CCNetLabel附加到另一个变量,所以我需要访问ccnet.config中的属性.
是否有不同的方式来引用这些变量?
Dar*_*ryl 21
我们也需要这样做,并发现我们可以使用CruiseControl.NET 1.5中引入的Replacement Dynamic Values从ccnet.config中访问CCNetLabel.
例如,此代码段中的dynamicValues块:
<buildpublisher>
<sourceDir>C:\ccnet_projects\Installer\bin\x86\Release</sourceDir>
<dynamicValues>
<replacementValue property="publishDir">
<format>C:\builds\installers\{0}\x86</format>
<parameters>
<namedValue name="$CCNetLabel" value="Default" />
</parameters>
</replacementValue>
</dynamicValues>
<useLabelSubDirectory>false</useLabelSubDirectory>
</buildpublisher>
Run Code Online (Sandbox Code Playgroud)
生成包含动态CCNetLabel值的publishDir路径:
<buildpublisher>
<sourceDir>C:\ccnet_projects\Installer\bin\x86\Release</sourceDir>
<publishDir>C:\builds\installers\1.0.2.120\x86</publishDir>
<useLabelSubDirectory>false</useLabelSubDirectory>
</buildpublisher>
Run Code Online (Sandbox Code Playgroud)
(请注意,对于此特定示例,useLabelSubDirectory设置为false以避免将CCNetLabel附加到publishDir路径.)
无法在CCNET配置中访问这些环境变量.我想几乎任何配置CCNET(包括我自己)的人都试图这样做.此功能经常被要求,但尚未实施.
如果您想要访问CCNetWorkingDirectory
或CCNetArtifactDirectory
有解决方法:
<cb:define name="project.workingDirectory">c:/foo</cb:define>
<cb:define name="project.artifactDirectory">c:/bar</cb:define>
<project>
<workingDirectory>$(project.workingDirectory)</workingDirectory>
<artifactDirectory>$(project.artifactDirectory)</artifactDirectory>
...
</project>
Run Code Online (Sandbox Code Playgroud)
但我不知道访问的解决方案CCNetLabel
.对不起,我没有更好的消息.
以下文章应该能够帮助您.您可以cb:scope
在a中使用或定义整个项目,cb:define
并传递项目名称.
-祝好运-
http://confluence.public.thoughtworks.org/display/CCNET/Configuration+Preprocessor
归档时间: |
|
查看次数: |
23040 次 |
最近记录: |