By default Cruise Control stores the all important ccnet.config file in %ProgramFiles%\CruiseControl.NET\Server,  if you didn’t know CC.Net also monitors this file and will rebuild itself if it detects a change. 

Now the main problem with the default location for ccnet.config is that this is not under source control, so if your build server happens to suddenly “disappear” (this has happened to me) then you’ve lost all of your project configuration.

What I like to do is store ccnet.config in source control and create a project in ccnet.config that monitors this file. 

Benefits:

  • CCNet.Config is safe and sound versioned under source control
  • Any developer can check out the file and create new projects
  • Best of all Cruise Control will detect any changes and magically rebuild itself!  How cool is that!?

Here’s how I do it:

  1. Create a new folder structure under source control Build Servers\[SERVER_NAME]\Server
    (By using the build server name you can store multiple server ccnet configs)
  2. Checkin your %ProgramFiles%\CruiseControl.NET\Server\ccnet.config file to the Server folder in step 1
    (Copy it to your working folder first!)
  3. Modify the following line in %ProgramFiles%\CruiseControl.NET\Server\ccservice.config replacing the path with the location of your working copy on location on the build server.
  4. <add key="ccnet.config" value="C:\Builds\CCNet\Server\ccnet.config"/>
  5. Create a new project in ccnet.config like the following:
  6. <!-- 
      *********************************************************************************************************************************************
      Cruise Control Config file - Monitors for changes to the main cruise control project config file 
      *********************************************************************************************************************************************
      -->
    <project>
      <name>Lon-Build-01 - Config File</name>
      <webURL>http://Lon-Build-01/ccnet/server/local/project/Lon-Build-01+-+Config+File/ViewProjectReport.aspx</webURL>
      <triggers>
        <intervalTrigger seconds="60"/>
      </triggers>
      <workingDirectory>c:\builds\CCNet\Server</workingDirectory>
      <modificationDelaySeconds>0</modificationDelaySeconds>
      <sourcecontrol type="svn">
        <executable>C:\Program Files\SlikSvn\bin\svn.exe</executable>
        <trunkUrl>svn://Lon-Build-01/BuildServers/Trunk/Lon-Build-01/Server</trunkUrl>
        <tagOnSuccess>false</tagOnSuccess>
      </sourcecontrol>
     
      <publishers>
        <statistics />
      </publishers>
     
      <externalLinks>
        <externalLink name="IIS Root Web on Localhost" url="http://localhost/" />
      </externalLinks>
    </project>
  7. Restart the Cruise Control service

Now you have a versioned ccnet.config file and an auto rebuilding build server!

 

PS Don’t forget to add the new proecjt in CC tray!


Comments


United States Kareem
July 29. 2009 23:04
Kareem
Nice lil article... I've been trying to do the same thing, but mine isn't working....

I've modified the ccservice.exe.config file and the ccnet.exe.config file to have the following line under the <AppSettings>:

<add key="ccnet.config" value="C:\Documents and Settings\Administrator\Perforce\build-ws3\dev\ccnet\ccnet.config"/>

To no avail once I do a reboot or server restart it still looks in the default location... Any ideas? I'm kinda pulling my hair out here!

Thanks!

no site


July 29. 2009 23:56
Admin
Hmmm...Haven't seen that before it normally works or complains.  One thing I've noticed is that you have spaces in the path but I don't think that should make a difference though.  Have you tried stopping ccnet service and running the command line ccnet start so you can see the log details?  Anything in the eventlog?

http://www.ifunky.net/http://www.ifunky.net/

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



Calendar

«  May 2012  »
MoTuWeThFrSaSu
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910
View posts in large calendar

Recent Comments

Banners

Theme Grabber
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2012 Dan Gibbons .Net Developer