![]() ![]() |
|||||||||||||
| :: Home |
| :: About Us |
| :: Technical |
| :: Résumé |
| :: Photos |
| :: My Blog |
| :: In Focus |
| :: Y! Pipes |
| :: Imageflow new! |
| :: Contact Us |
| :: Feedback |
Continuous Integration
Wikipedia defines it
as a software engineering process that completely
rebuilds and tests an application frequently. Although the
underlying concepts existed earlier, "continuous integration"
typically refers to the extreme programming practice.
I got to know about it as my client
insisted that we use it in our current project. So I was asked to explore it
and understand it and then implement it.
I just completed the implementation.
And hence CI as it is known becomes my first technical document. YAY! (I didn’t
expect to have an article in this section so soon!)
In a nutshell,
There is a server process that monitors
the version control system for any changes in the source code that is checked
in. If there is a change than it triggers the build process and executes unit
test cases if specified.
Simple so far right?
Ok, Now the advantages…
1) We all know that finding a problem as early as possible
directly reduces the cost of fixing it.
2) Broken code / incompatible code is detected as soon as it
is checked in
3) Immediate unit testing of all changes
4) The details of the current build is available to
all the concerned people
5) The immediate impact of checking-in incomplete or
broken code acts as an incentive to developers to learn to work more
incrementally with shorter feedback cycles.
If
you googled “continuous integration” you will come across an article by on Martin
Fowler which I would recommend you to read.
I
will not be spending a lot of time with CI, what this article will help you do is
do a quick install of
CruiseControl.NET
on a XP box with .Net Framework 1.1 and VSS as your version control.
CruiseControl.NET
is an Automated Continuous Integration server, implemented using the Microsoft
.NET Framework.
CruiseControl.NET
(CCNet) consists of a suite of applications, but at its core is the
CruiseControl.NET Server which is an automated integration server. The server
automates the process of integration by polling the source code repository (VSS
in my case). When it detects any changes it triggers the build process, (NAnt
in my case). Once the build is complete it publishes the result of whether the
code checked in integrated successfully or not. It suite also has a client
application CCTray that if installed can notify all the team members of the
build status. There is also an emailing function that will generate emails to
alert the groups/ users of the build status. Also if the NUnit test cases are
configured than they will be executed.
Effectively,
integration becomes as easy as checking in code. Using an automated integration
server not only makes integration easy, it also guarantees that an integration
build will happen. There is no danger of developers forgetting to validate
their changes after checking in.
The
CCNet Server offers several key features:
Integration with a variety of Source Control
systems
Integration with other external tools, such as
NAnt and Visual Studio
Can build multiple projects on one server
Remote management and reporting
The
core settings are configured in the ‘ccnet.config’
file located in the server folder of your CruiseControl.NET installation.
Here
is a typical configuration
<cruisecontrol>
<project
name="Project">
<sourcecontrol
type="vss" autoGetSource="true"
applyLabel="true">
<executable>C:\Program
Files\Microsoft Visual Studio\VSS\win32\SS.EXE</executable>
<project>$/Project/</project>
<ssdir>C:\Program
Files\Microsoft Visual Studio\VSS\</ssdir>
<workingDirectory>C:\Project\</workingDirectory>
<cleanCopy>false</cleanCopy>
</sourcecontrol>
<tasks>
<nant>
<executable>C:\nant-0.85\bin\NAnt.exe</executable>
<baseDirectory>C:\Project2</baseDirectory>
<buildFile>default.build</buildFile>
<targetList>
<target>build</target>
</targetList>
<buildTimeoutSeconds>3000</buildTimeoutSeconds>
</nant>
</tasks>
<publishers>
<xmllogger>
<logDir>.websitelog</logDir>
</xmllogger>
</publishers>
</project>
</cruisecontrol>
Hope
this helps.
So
once this is done, start the CruiseControl.NET server. Check out some code from
the VSS, modify it and check it in. After a while the automated integration
process should kick in if all is configured well. The dashboard would show the
result of the build. Typically http://localhost/ccnet
If you have installed the CCTray then a little balloon
would pop up in your task bar informing you the status.
Enjoy!
© Copyright 2010 iRohit.com. All Rights Reserved.
This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License. |