Reputation: 22441
I am trying to define some values in my ccnet.config file.
I am running version 1.4.4.83.
I added xmlns:cb="urn:ccnet.config.builder" to my main cruisecontrol element.like:
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
next I defined some defines processor constants:
<cb:define prodbuildtag="1.1.25.1207" />
<cb:define testbuildtag="1.1.25.1207">
finally I tried to reference the define values in a tag like so:
<sourcecontrol type="svn">
<trunkUrl>https://someserver/svn/myproject/tags/$(prodbuildtag)</trunkUrl>
<username>johnDoe</username>
<password>JelloW0r1d</password>
<tagOnSuccess>false</tagOnSuccess>
<tagBaseUrl>https://someserver/svn/myproject/tags/</tagBaseUrl>
</sourcecontrol>
When I bulid using the script it treats the define $(prodbuildtag) as an empty string and checkes out the code based on the trunkUrl 'https://someserver/svn/myproject/tags/'. I am having trouble getting the Configuration Preprocessor to work; please help.
Upvotes: 0
Views: 1658
Reputation: 388
I know that this works because we do it all the time. Here is an example of what we have in our ccnet.config file:
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<cb:define svnPath="C:\Program Files\CollabNet Subversion\svn.exe"/>
<cb:define svnReposRootUrl="http://someserver/svn"/>
<!-- cc.net auto-updating config project -->
<project name="ccnet-config">
<triggers>
<intervalTrigger seconds="30"/>
</triggers>
<sourcecontrol type="svn">
<workingDirectory>C:\Program Files\CruiseControl.NET\server\config</workingDirectory>
<executable>$(svnPath)</executable>
<trunkUrl>$(svnReposRootUrl)/build/trunk/ccnet/config/XMGBUILD01</trunkUrl>
</sourcecontrol>
</project>
</cruisecontrol>
It's not clear from your question where the cb:define tag is in relation to where you are using it. I would try putting it as child of the cruisecontrol element. I don't know if it can be a child of anything else... I've never tried.
Upvotes: 0
Reputation: 8749
I tested the code you posted in 1.5 and it seems to work. If you are including multiple files make sure you have <cruisecontrol xmlns:cb="urn:ccnet.config.builder">
in each file
I think $() syntax resolves environment variables as well.
Upvotes: 1