R – CruiseControl.Net “Duplicate Node Detected” using precompiler

cruisecontrol.net

I am working with CruiseControl.Net and am trying to take the dry approach as illustrated in article http://www.zorched.net/2009/01/30/dry-your-cruisecontrolnet-configuration/ I have a simple ccnet.config and a simple projectfile Test-project.xml. The configuration valuation tool tells me that “Duplicate Node Detected”. Any clues/Hints would be great.

Ccnet.config

<cruisecontrol  xmlns:cb="urn:ccnet.config.builder">
  <!-- Standard Inits -->
  <cb:define name="StandardInit-block">
    <webURL>http://localhost/ccnet-dashboard/?_action_ViewProjectReport=true&amp;server=local&amp;project=Introvert</webURL>
    <artifactDirectory>D:\CC\$(ProjName)\artifact\</artifactDirectory>
    <modificationDelaySeconds>120</modificationDelaySeconds>
  </cb:define>

  <!-- Trigger run weekly -->
  <!-- Vars $(TriggerTime), $(ProjName) -->
  <cb:define name="WeeklyBuild-block">
    <triggers>
      <scheduleTrigger time="$(TriggerTime)" buildCondition="ForceBuild" name="Nightly build at $(TriggerTime) for $(ProjName)">
        <weekDays>
          <weekDay>Monday</weekDay>
          <weekDay>Tuesday</weekDay>
          <weekDay>Wednesday</weekDay>
          <weekDay>Thursday</weekDay>
          <weekDay>Friday</weekDay>
        </weekDays>
      </scheduleTrigger>
    </triggers>
  </cb:define>

  <cb:include href="Test-project.xml" xmlns:cb="urn:ccnet.config.builder"/>
</cruisecontrol>

Test-project.xml

<project name="Test" xmlns:cb="urn:ccnet.config.builder">

    <cb:scope
      TriggerTime="2:30"
      ProjName="Test"
      ProjStarPath="" >

      <!-- Standard block -->
      <cb:StandardInit-block/>

      <!-- Trigger block -->
      <cb:WeeklyBuild-block/>

      <tasks></tasks>
      <publishers></publishers>

    </cb:scope>
  </project>

Best Answer

ccnet.config:

<cruisecontrol xmlns:cb="urn:ccnet.config.builder"> 

    <!-- Standard Inits --> 
    <cb:define name="StandardInit-block">

        <!--<webURL>http://localhost/ccnet-dashboard/?_action_ViewProjectReport=true&server=local&project=Introvert</webURL>-->
        <artifactDirectory>D:\CC\$(ProjName)\artifact\</artifactDirectory> 
        <modificationDelaySeconds>120</modificationDelaySeconds> 

    </cb:define>

    <!-- Trigger run weekly --> 

    <!-- Vars $(TriggerTime), $(ProjName) --> 
    <cb:define name="WeeklyBuild-block"> 

        <triggers> 
            <scheduleTrigger time="$(TriggerTime)" buildCondition="ForceBuild" name="Nightly build at $(TriggerTime) for $(ProjName)"> 
                <weekDays> 
                    <weekDay>Monday</weekDay> 
                    <weekDay>Tuesday</weekDay> 
                    <weekDay>Wednesday</weekDay> 
                    <weekDay>Thursday</weekDay> 
                    <weekDay>Friday</weekDay> 
                </weekDays>
            </scheduleTrigger> 
        </triggers> 

    </cb:define>

    <cb:include href="Test-project.xml" /> 

</cruisecontrol>

Test-project.xml:

<project name="Test" xmlns:cb="urn:ccnet.config.builder">

    <cb:scope
        TriggerTime="2:30"
        ProjName="Test"
        ProjStarPath="" >

    <!-- Standard block -->
    <cb:StandardInit-block/>

    <!-- Trigger block -->
    <cb:WeeklyBuild-block/>

    <tasks/>
    <publishers/>

    </cb:scope>
</project>

Having just run this lot through cruisecontrol on my box, the only problem i get is the URL in the ccnet.config file. remove that and the code i pasted above this text works fine.