Friday, November 25, 2011

CruiseControl.NET Server Configuration (ccnet.config)

To configure the CruiseConrol.NET Server, the configuration file (ccnet.config) has to be configured and placed in the "server" folder which will be used by Cruise Control .NET for continuous integration. This sample file contains the settings for one of the test application created in Visual Studio. I have tried to configure all the possible settings which are used in practical situations.

This example uses Visual Source Safe (VSS) as the source control application which check for any modifications in VSS (IfModificationExists)  every 60 seconds.If any check-in happen in VSS, CruiseControl will pick get the latest files and prepare a auto build.

ccnet.config file

<cruisecontrol>
  <project name="CCTestApp" webURL="http://localhost/ccnet/server/local/project/CCTestApp/ViewProjectReport.aspx">
    <workingDirectory>C:\CruiseControlTest\BuildServer\CCTestApp</workingDirectory>
   <artifactDirectory>C:\CruiseControlTest\BuildServer\CCTestApp\Artifacts</artifactDirectory>
    <labeller type="defaultlabeller">
        <prefix>lblCCTestApp_build_</prefix>
        <incrementOnFailure>true</incrementOnFailure>
    </labeller>   
    <sourcecontrol type="vss" autoGetSource="true">
        <project>$/CCTestApp</project>
        <username>t799153</username>
        <password></password>
        <ssdir>C:\Chandreshwar\PROJ\DOTNET\VSS_DB\</ssdir>
       <workingDirectory>C:\CruiseControlTest\BuildServer\CCTestApp\Source</workingDirectory>
        <cleanCopy>true</cleanCopy>
        <applyLabel>false</applyLabel>
    </sourcecontrol>
    <triggers>
        <intervalTrigger seconds="60" buildCondition="IfModificationExists"/>
    </triggers>   
    <tasks>
        <devenv solutionfile="C:\CruiseControlTest\CCTest\CCTest.sln" configuration="release" executable="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.exe"/>
        <modificationWriter>
             <filename>modifications.xml</filename>
             <path>C:\CruiseControlTest\BuildServer\CCTestApp</path>
        </modificationWriter>
    </tasks>
    <publishers>
      <xmllogger logDir="C:\CruiseControlTest\BuildServer\CCTestApp\BuildLogs" />
    </publishers>
  </project>
</cruisecontrol>


You can find the complete reference of all the configuration settings in CruiseControl.NET here.

1 comment: