< cruisecontrol>
< project name = "test" >
</project>
</cruisecontrol>
Friday, 21 November 2008
Wednesday, 19 November 2008
Getting started with Cruisecontrol.net
After installing CC.net, a configuration file needs to be created (ccnet.config), all project settings are located in it.
- Ccnet.config
In order to get CC.net server up and running, its configuration file needs to be edited, Basic structure of the config file is:
<?xml version="1.0" encoding="utf-8" ?>
<cruisecontrol>
<!-- myproject project -->
<project name = "myproject1">
<!--project URL-->
<webURL>http://localhost/ccnet</webURL>
<!--Project directories-->
<workingDirectory>C:\projects\myproject1</workingDirectory>
<artifactDirectory>\\computername\Continious Integration\project1\Artifacts</artifactDirectory>
<!-- Current Build date for build identification purposes-->
<labeller type="dateLabeller"/>
<!-- Interval when the build process will be triggred-->
<triggers> <!-- Check every 1,5 hours for modifications-->
<intervalTrigger seconds="5400" buildCondition="IfModificationExists" />
</triggers>
<!-- Source Control in use and our project location-->
<sourcecontrol type="vss">
<project>$/VSSSOURCE/myproject1</project>
<username>myusername</username>
<password>password</password>
<ssdir>\\VSSSOURCE</ssdir>
</sourcecontrol>
<tasks>
<!--USE MSDev enviroment for building project-->
<devenv>
<solutionfile>C:\projects\myproject1\project1.sln</solutionfile>
<configuration>debug</configuration>
</devenv>
<!--NANT is used for build and test purposes-->
<nant>
<executable>C:\nant\bin\nant.exe</executable>
<buildFile>C:\Continious Integration\build files\project1.build</buildFile>
<logger>NAnt.Core.XmlLogger</logger>
<buildArgs>fxcop coverage coverage.explr simian</buildArgs>
</nant>
<!-- NUnit to Run the tests-->
<nunit>
<path>C:\Program Files\NUnit 2.4.8\bin\nunit-console.exe</path>
<assemblies>
<assembly>C:\projects\myproject1\myproject_UNITTEST.dll</assembly>
</assemblies>
</nunit>
</tasks>
<publishers>
<!-- merge xml -->
<merge>
<files>
<file>C:\results\CoverageReport.xml</file> <!-- NCover code coverage Results -->
<file>C:\results\fxcop.xml</file> <!-- FxCop -->
<file>C:\results\simian.xml</file> <!-- Similarity analyser SIMIAN report -->
</files>
</merge>
<!--Email notification and logs begin here-->
<!--email notification to groups depending on build and test results -->
<email from="buildautomation@mail.box" mailhost="mail.mail.box" includeDetails ="TRUE">
<!--USERS-->
<users>
<user name="user1" group="TestQA" address="user1@mail.box" />
</users>
<!-- Groups in which users are classified -->
<groups>
<group name="TestQA" notification="always"/>
<group name="developers" notification="always"/>
</groups>
</email>
<statistics/>
<xmllogger/>
</publishers>
</project>
</cruisecontrol>
If there are no errors then the server will look like this
Wednesday, 29 October 2008
Cruisecontrol.net
But how does it work?
1. The CruiseControl.NET Server is started, and a project is started according to a Project Configuration Block in the Server's Configuration
2. CCNet checks the source code repository for modifications that have occurred since the last build attempt.
3. When modifications are detected
a. CCNet labels the project with CCNETUNVERIFIEDxxx (xxx = date/time) (Visual Source Safe only, optionally)
b. CCNet gets the latest version of the source from the source control repository
c. CCNet starts the build by executing the tasks in thesection of the ccnet.config file. In this example, the build will execute the task to run the NAnt build file.
4. NAnt processes the build script specified by the
a. NAnt runs VS.NET using either thetask or the task. The task provides better reporting capability for later steps.
b. NAnt runs NUnit using thetask or the task
c.NAnt runs FxCop using thetask
5. CCNet receives the outcome of the NAnt execution (Success/Failed)
a. If the build was successful, CCNet replaces the CCNETUNVERIFIEDxxx label with the next sequential build number. (VSS only)
b. The XML output files are gathered from each step using the File Merge Task and output as an xml file in the log directory specified in theelement.
6. CCNet sends out email based on the
a. Ifis set, then the individuals will only receive email if the status of the build changes (Success -> Fail, or Fail -> Success)
b. Ifis set, then the individuals will receive email for every build.
7. CCTray displays current status of the build in the client system tray. The user can use the "Launch web page" menu item to browse to the build status website.
8. Project Dashboard enables multiple continuous integration projects to be viewed.
In short the process is like:
Where do we begin?
1. Set up a build automation system.
2. Run builds when changes were made to the project.
3. Send notification to developers about build status.
4. Run tests.
What to choose?
My priority was to use opensource build automation system. But I evaluated comercial ones too. Why opensource, when I can use any comercial program? Well, the freedom to make changes and contribute to the community give satisfaction at the end of the day, firstly I have ability to fine tune the code to my specification and secondly I can share my views with other users and make it better. I came across CruiseControl.net by thoughtworks. ".net" because it supports net.framework.
The software I was to test is written in Microsoft's C++.
"...talking about C++, I have had many problems with it. It's like a monster, but does the job prefectly..."
What do I need?
1. Cruisecontrol.net - The mother
2. NAnt - for creating the build file
Software testing
Build Automation
1. Compiling computer source code into binary code
2. Packaging binary code
3. Running tests
4. Deployment to production systems
5. Creating documentation and or release notes
This automated build is in contrast to a manual build process where a person has to perform multiple, often tedious and error prone tasks. The goal of this automation is to create a one-step process for turning source code into a working system. This is done to save time and to reduce errors.