KnowledgeTree

Bunch of Technology Solution

CRUISECONTROL + SOURCE VAULT + devenvbuild


Recently i got the opportunity to setup a build automation system in my organization.
This was something new that i didn’t do previously and was a good start for a new learning
in my free time, so i was very much excited about it.

SO instead of going into depth about telling you about different build automation tool(google it!), i
would directly start with the tool called ‘cruiseControl’ which is a build automation framework
which almost support all the building tool like devenv(visual studio),NANT,msbuild etc.

So this article is all about the combination of cruisecontrol (build autmation framework) ,
Source Vault (Project Repository) and devenv.com (building tool).

Pre Requisite :- download and install latest version of cruise control (mine is v1.4.4)

SOurce vault repository present and Visual studio 2005/2008 installed

All the settings which you would like to make to a file and would like the behavior be as per the
settings described in the one file are done in the ccnet.config. The path to the ccnet.config is
c:\program files\cruisecontrol.NET\server.

In my organization i configured the build server for windows application.
The build server performed some particular task and all the tags for it are in the code below

1)To take the source from the source vault/fortress use vault/fortress client to authenticate and
get the latest code form the source repository
2)Building the latest code using the devenv.com
3)Publishing the latest build on the network drive or on a local drive which is shared
4)Writing the build log for every failure or exception or successful build
5)And then sending the email notification to the admin for every build ,automatically triggered
or forced build and for the developers separately if the build fails by the developer.

Below is the code for the ccnet.config for above tasks

<cruisecontrol xmlns:cb=”urn:ccnet.config.builder”>

<project>

<name>Project1</name>

<triggers>

<intervalTrigger seconds=”1800″/>

</triggers>

<sourcecontrol type=”vault” autoGetSource=”true” applyLabel=”true”>

<executable>C:\Program Files\SourceGear\Fortress Client\vault.exe</executable>

<username>username for source vault/fortress</username>

<password>password for source vault/fortress</password>

<host>Source vault/Fortress Server name</host>

<repository>Root Directory name</repository>

<folder>$/Project1/</folder>

<ssl>false</ssl>

<timeout units=”minutes”>10</timeout>

<useWorkingDirectory>true</useWorkingDirectory>

<workingDirectory>C:\Program Files\CruiseControl.NET\server\Project1\WorkingDirectory</workingDirectory>

{ this is default, you can change it to your desired location}

</sourcecontrol>

<tasks>

<devenv>

<solutionfile>C:\Program Files\CruiseControl.NET\server\RecoveryTrac\WorkingDirectory\Project1.sln</solutionfile>

<configuration>Debug</configuration>

<executable>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.com</executable>

<buildTimeoutSeconds>600</buildTimeoutSeconds>

<version>VS2008</version>

</devenv>

</tasks>

<publishers>

<buildpublisher>

<sourceDir>C:\Program Files\CruiseControl.NET\server\Project1\WorkingDirectory</sourceDir>

<publishDir>C:\CruiseBuilds\Project1\test_build</publishDir>

<useLabelSubDirectory>true</useLabelSubDirectory>

<alwaysPublish>false</alwaysPublish>

</buildpublisher>

<xmllogger />

<email mailhost=”SMTP Server name” from=”admin@admin.com” includeDetails=”true”>

<users>

<user group=”buildmaster” address=”admin@admin.com”/>

<user group=”developers” address=”developer1@admin.com”/>

<user group=”developers” address=”developer2@admin.com”/>

</users>

<groups>

<group notification=”change”/>

<group notification=”always”/>

</groups>

</email>

</publishers>

</project>

</cruisecontrol>

Thats It!

More on NANT and msbuild soon…

Thanks

Sudhir

October 13, 2009 - Posted by | Configuration Management | , , , , , , , ,

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: