CruiseControl.NET Continuous Integration Server
Overview
The CruiseControl.NET Continuous Integration Server allows for automated continuous builds. These builds are triggered when new source code is committed to the source code repository and the build process can include steps to perform unit testing as well as other various build related tasks. More information can be found at the CruiseControl.NET website: http://ccnet.thoughtworks.com. This article assumes that you are using CVSDude as your SCM provider, but using an internal provider will require few changes.
Installation Prerequisites
These are the installation prerequisites for CruiseControl.NET Server. http://confluence.public.thoughtworks.org/display/CCNET/Installation+Prerequisites
- Microsoft .NET Framwork 2.0
- ASP.NET enabled web server (typically IIS with ASP.NET configured)
CruiseControl.NET Server Installation
The following steps are required to install the CruiseControl.NET Server and Web Dashboard.
- Download latest release of CruiseControl.NET on the build server. http://sourceforge.net/project/showfiles.php?group_id=71179&package_id=83198
- Execute the CruiseControl.NET setup installer on the build server.
- Click on the “Next >” button.
- Click on the “I Agree” button.
- Leave all of the CuirseControl.NET Server, Web Dashboard, and Examples components selected and click on the “Next >” button.
- Leave the “Install CC.Net server as a Windows service” and “Create virtual directory in IIS for Web Dashboard” options selected and click on the “Next >” button.
- Leave the default destination folder as “C:\Program Files\CruiseControl.NET” and click on the “Next >” button.
- Click on the “Install” button and wait for the “Installation Complete” message.
- Click on the “Next >” button.
- Click on the “Finish” button.
CruiseControl.NET Server Windows Service Configuration
The following steps are required to ensure that the CruiseControl.NET Server Windows service is automatically started when Windows starts.
- Click on the “Start” menu.
- Click on “Run…”.
- Enter “services.msc” and click on the “OK” button.
- Right-click the “CruiseControl.NET Server” service and click on the “Properties” menu option.
- Click on the “Log On” tab.
- Click on the “This account” radio button.
- Enter the username and password for the account that is currently logged into the build server. This is required because subversion will not be able to verify the trust of CVSDude’s certificate. In a future step below we will permanently cache our decision to trust CVSDude’s certificate and that is why the user credentials must match since the cached server authentication is stored in a user director (i.e. “C:\Documents and Settings\Username\Application Data\Subversion\auth\svn.ssl.server”.
- Click on the “General” tab.
- Change the startup type to “Automatic”.
- Click on the “Start” button.
- Click on the “OK” button.
- Close the Services window.
CruiseControl.NET Web Dashboard Configuration
The following steps are required to ensure that the CruiseControl.NET Web Dashboard is property configured to run as an ASP.NET 2.0 application.
- Click on the “Start” menu.
- Click on “Run…”.
- Enter “inetmgr” and click on the “OK” button.
- Expand the “(local computer)” node.
- Expand the “Web Sites” node.
- Expand the “Default Web Site” node.
- Right-click on the “ccnet” virtual directory and click on the “Properties” menu option.
- Click on the “ASP.NET” tab.
- Ensure that the ASP.NET version is set to 2.0.50727.
- If there are other ASP.NET 1.x applications on this web server then you will need to make sure that the ASP.NET 1.x and ASP.NET 2.0 application use separate application pools for the different ASP.NET versions.
- Click on the “OK” button.
- Close the Internet Information Services Manager window.
- Open http://localhost/ccnet in a browser and ensure that the website displays without errors.
Subversion Installation
The following steps are required to install Subversion on the build server.
- Download the Win32 binary package of Subversion onto the builder server.
http://subversion.apache.org/packages.html - Extract the contents of the zip file’s versioned “svn-win32-#.#.#” directory into the “C:\Program Files\Subversion” directory.
- Download ThoughtWorks.CruiseControl.MSBuild.dll to the “C:\Program Files\CruiseControl.NET” directory.
http://ccnetlive.thoughtworks.com/MSBuildXmlLogger-Builds/ThoughtWorks.CruiseControl.MSBuild.dll
CruiseControl.NET Project Configuration
The following steps are required to configure CruiseControl.NET.
- Create a build directory (ex. C:\CruiseControl.NET.Builds).
- Create the project directory in the build directory created in step 1 (ex. C:\CruiseControl.NET.Builds\[PROJECT_NAME_GOES_HERE]).
- Run the following command from the C:\Program Files\Subversion\bin directory.
svn checkout https://[REPOSITORY_URL_GOES_HERE] c:\CruiseControl.NET.Builds\[PROJECT_NAME_GOES_HERE] --username user --password pass - You will be prompted that there was an error validating the server certificate. Press ‘p’ to permanently cache the authentication.
- Setup the IIS virtual directory for project.
- Open the C:\Program Files\CruiseControl.NET\server\ccnet.config file in a text editor.
- Add a project section to the ccnet.config file.
<project>
<workingDirectory>C:\CruiseControl.NET.Builds\[PROJECT_NAME_GOES_HERE]\</workingDirectory>
<webURL>http://localhost/ccnet</webURL>
<sourcecontrol autoGetSource="true">
<trunkUrl>https://[REPOSITORY_URL_GOES_HERE]</trunkUrl>
<executable>C:\Program Files\Subversion\bin\svn.exe</executable>
<workingDirectory>C:\CruiseControl.NET.Builds\[PROJECT_NAME_GOES_HERE]\</workingDirectory>
<username>username</username>
<password>password</password>
</sourcecontrol>
<tasks>
<msbuild>
<executable>C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
<workingDirectory>C:\CruiseControl.NET.Builds\[PROJECT_NAME_GOES_HERE]</workingDirectory>
<projectFile>[PROJECT_NAME_GOES_HERE].sln</projectFile>
<buildArgs>/noconsolelogger /p:Configuration=Debug /v:diag</buildArgs>
<targets>Build</targets>
<timeout>15</timeout>
<logger>ThoughtWorks.CruiseControl.MsBuild.XmlLogger,C:\Program Files\CruiseControl.NET\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
</msbuild>
</tasks>
<triggers>
<intervalTrigger name="continuous" seconds="3600" buildCondition="IfModificationExists" />
</triggers>
<publishers>
<xmllogger>
<logDir>C:\CruiseControl.NET.Builds\Logs\[PROJECT_NAME_GOES_HERE]\</logDir>
</xmllogger>
</publishers>
</project> - Open the “C:\Program Files\CruiseControl.NET\webdashboard\dashboard.config” configuration file.
- Add the line “<xslFile>xsl/compile-msbuild.xsl</xslFile>” to the list of <xslFileNames></xslFileNames> section.
- Add a <xslReportBuildPlugin /> item.
<xslReportBuildPlugin description=”MSBuild Output” actionName=”MSBuildOutputBuildPlugin” xslFileName=”xsl\msbuild.xsl” /> - Restart the CruiseControl.NET Service (i.e. Start->Run…->services.msc).