tags:

views:

391

answers:

2

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)&lt;/trunkUrl&gt;
    <username>johnDoe</username>
    <password>JelloW0r1d</password>
    <tagOnSuccess>false</tagOnSuccess>
    <tagBaseUrl>https://someserver/svn/myproject/tags/&lt;/tagBaseUrl&gt;
</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.

+1  A: 

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.

Ryu
in trying to get this to work I added <cb:define prodbuildtag="1.1.25.1207" testbuildtag="1.1.25.1207" /> as a combined define. When I switch it back as it is posted above it started working. I had had it that way at first so I'm not exactly sure what my first problem was.
minty
A: 

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"/&gt;

  <!-- 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.

Dustin

related questions