0
votes

Have just started to use CruiseControl.NET for a small project we are working on and I'm having trouble merging an XML file into the email publisher that runs once the build is completed.

From what I've read I need to ensure that the merge tag appear before the xml logger and the file has to exist in the specified location, which is what I've done below.

<merge>
     <files>
         <file>C:\CCNet\xxx.xml</file>
     </files>
</merge>    
<xmllogger />

The file I'm trying to merge in was originally the result of a NAnt/NUnit output, however in trying to diagnose the issue I eliminated that as a possibility by merging in a static XML file as above from a known location and still having the same issue.

Does the XML have to be in a specific format? Am I mean't do load an XSL file so that the email publisher knows how to display it?

Full build script is below in case it is needed.

<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
    <cb:define MainDir="C:\CCNet"/>
    <cb:define WorkingDir="Working"/>
    <cb:define ReleaseDir="Release"/>
    <cb:define ArtifactsDir="BuildArtifacts"/>
    <cb:define StateDir="State"/>

    <cb:define name="BuildTask">
        <nant>
            <baseDirectory>$(MainDir)\$(WorkingDir)\NaturalTalent\$(Build)</baseDirectory>
            <executable>C:\Program Files\nant-0.92\bin\NAnt.exe</executable>
            <buildFile>default.build</buildFile>                
            <buildArgs>-D:CCNetReleaseDirectory=$(MainDir)\$(ReleaseDir)\NaturalTalent\$(Build)</buildArgs>
        </nant> 
    </cb:define>

    <cb:define name="CommonProjectSettings">
        <state type="state" directory="$(MainDir)\$(StateDir)" />
        <workingDirectory>$(MainDir)\$(WorkingDir)\NaturalTalent\$(Build)</workingDirectory>
        <artifactDirectory>$(MainDir)\$(ArtifactsDir)\NaturalTalent\$(Build)</artifactDirectory>

        <sourcecontrol type="git">
            <repository>http://cruizecontrol:[email protected]/gitlab/nga.git</repository>
            <workingDirectory>$(MainDir)\$(WorkingDir)\NaturalTalent\$(Build)</workingDirectory>
        </sourcecontrol>

        <publishers>
            <merge>
                 <files>
                     <file>C:\CCNet\xxx.xml</file>
                 </files>
            </merge>        

            <statistics />
            <xmllogger />
            <artifactcleanup cleanUpMethod="KeepLastXBuilds" cleanUpValue="50" />

            <email from="[email protected]" mailhost="bart" mailport="25" includeDetails="true">
                <users>
                    <cb:Users />
                </users>
                <groups>
                    <group name="developers">
                      <notifications>
                        <notificationType>Failed</notificationType>
                        <notificationType>Fixed</notificationType>
                      </notifications>
                    </group>
                    <group name="buildmaster">
                      <notifications>
                        <notificationType>Always</notificationType>
                      </notifications>
                    </group>
                </groups>
                <xslFiles>
                    <file>xsl\header.xsl</file>
                    <file>xsl\compile.xsl</file>
                    <file>xsl\modifications.xsl</file>                  
                  </xslFiles>               
            </email>
        </publishers>           
    </cb:define>

    <project name="NaturalTalent (TRUNK) - Latest">
        <cb:scope Build="Latest">
            <cb:define name="Users">
                <user name="Anton Felich" group="buildmaster" address="[email protected]" />
                <!--<user name="David Ames" group="buildmaster" address="[email protected]" />
                <user name="David Ames" group="buildmaster" address="[email protected]" />-->
            </cb:define>

            <cb:CommonProjectSettings />

            <tasks>
                <cb:BuildTask />
            </tasks>                        

            <triggers>
                <intervalTrigger name="continuous" seconds="30" buildCondition="IfModificationExists" initialSeconds="5"/>
            </triggers>
        </cb:scope>
    </project>

    <project name="NaturalTalent (TRUNK) - Nightly">
        <cb:scope Build="Nightly">
            <cb:define name="Users">
                <user name="Anton Felich" group="buildmaster" address="[email protected]" />
                <!--<user name="David Ames" group="buildmaster" address="[email protected]" />-->
                <!--<user name="David Ames" group="buildmaster" address="[email protected]" />
                <user name="HouTan" group="buildmaster" address="[email protected]" />
                <user name="MickHutchinson" group="buildmaster" address="[email protected]" />
                -->
            </cb:define>                    

            <tasks>
                <cb:BuildTask />
                <nant>
                    <baseDirectory>$(MainDir)\$(WorkingDir)\NaturalTalent\$(Build)</baseDirectory>
                    <executable>C:\Program Files\nant-0.92\bin\NAnt.exe</executable>
                    <buildFile>default.build</buildFile>                
                    <buildArgs>-D:CCNetReleaseDirectory=$(MainDir)\$(ReleaseDir)\NaturalTalent\$(Build)</buildArgs>
                    <targetList>
                        <target>test</target>
                    </targetList>                   
                </nant>         
            </tasks>                        

            <cb:CommonProjectSettings />
        </cb:scope>

        <triggers>
            <scheduleTrigger time="23:30" buildCondition="ForceBuild" name="Nightly" />
        </triggers>
    </project>
</cruisecontrol>
1

1 Answers

1
votes

As long as the xml file contains well-formed xml (which it should be)......the "sucking up into the everything-in-the-build.xml should work fine with the task.

Since you're new, I'm gonna guess you may not have the directory set correctly.

Download this tool:

http://www.voidtools.com/download.php

Search for your "xxx.xml"........and then make sure the directory for the task is correct.

PS, you can use a wild card for the filename (as seen below), which is what I do.

  <publishers>
    <merge>
      <files>


     <file>C:\ExactFolderWhereThisFileExists\*RESULTS.xml</file>              


      </files>
    </merge>