When calling external processes like MSBuild cruise control sets environment variables. One of values is CCNetLabel. it holds the value of the current projects label. I want to use the same values in ccnet config itself but when I try ccnet config has a problem. I get the following error:
[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)
.....
----------
I actually want to append the CCNetLabel to another variable so I need to access the property in ccnet.config.
is there a different way to reference these variables?
I've solved this by adding an msbuild task in the publisher section (including the
CCNetLabel
in the path)I tried to do this as well and just ended up using a NANT script, where I can get to
CCNetLabel
as an environment variabl like so:The following articles should be able to help you. You may be able to use
cb:scope
, or defining your whole project in acb:define
and pass the project name in.-Good luck-
http://confluence.public.thoughtworks.org/display/CCNET/Configuration+Preprocessor
http://ferventcoder.com/archive/2009/05/21/uppercut---automated-builds---cruisecontrol.net-integration.aspx
There is no way of accessing these environment variables inside CCNET configuration. I think almost anybody who configured CCNET (including myself) has tried to do so. This feature has been requested often, but it hasn't been implemented yet.
If you want access to
CCNetWorkingDirectory
orCCNetArtifactDirectory
there is a workaround:But I'm not aware of a solution for accessing
CCNetLabel
. Sorry, I don't have better news.We had a need to do this too, and found that we could use Replacement Dynamic Values, introduced in CruiseControl.NET 1.5, to access the CCNetLabel from within ccnet.config.
For example, the dynamicValues block in this snippet:
Produces a publishDir path containing the CCNetLabel value on the fly:
(Note that for this particular example, useLabelSubDirectory is set to false to avoid appending the CCNetLabel to the publishDir path.)
I think Darryl's answer is the best approach to solve this problem in CCNET 1.5. Just two comments about the answer:
$[$Integration_Property]
. In your case, using$[$CCNetLabel]
would work.