Turning on cruise control

Security Briefs

Syndication

I spent most of the day yesterday getting CruiseControl.NET set up here at Pluralsight. We're always working on little projects (well, some larger than others) and making use of continuous integration seemed like a great idea. I was surprised how easy it was to get started with it. Craig was the impetus behind this effort, of course.

The best tip I can offer for you if you're thinking of installing and using CruiseControl.NET is to notice that there are actually two versions of the server, ccnet.exe and ccservice.exe. These do exactly the same thing, only one runs from the command line and the other runs in the background as a service. When you log in as an administrator and run ccnet.exe it naturally runs very smoothly. And this is where I started, with a very simple project that downloads code from one of our Subversion repositories. Once I got a NANT script working to build and deploy the code (I forgot how much I loved ANT; such a great idea for handling builds), I used ccnet to start testing the build under CruiseControl.

Once I debugged my NANT script and ccnet configuration, I tried flipping over to the service, and of course it simply didn't work. Naturally I wanted to run the service under a low-privilege account, but that account didn't have permissions to write to the CruiseControl log file, didn't have credentials to download files from our subversion repository, didn't have permissions to write those files to the working directory or deploy to the deployment folder. So here's the key: instead of debugging all of this using ccservice, just use runas to run a command prompt under the same user account that you plan to use for the service. Once I did that, I was able to figure out exactly what things I needed to do, from caching Subversion credentials in the user profile for the account, to setting up appropriate ACLs so the account could move files around and write to CruiseControl logs (which I also moved out of CruiseControl's program directory).

Once I got ccnet.exe working properly under the low-privilege account, I switched back to using the service, and voila! We now have a functioning installation of CruiseControl.


Posted Jan 18 2008, 07:26 AM by keith-brown
Filed under:

Comments

SM wrote re: Turning on cruise control
on 01-18-2008 10:04 AM
Take a look at Team Foundation Server. Since Pluralsight offers a course on VSTS/TFS, might be useful if you actually used it in-house. It'll also increase expertise in a product you teach, not to mention increase your cred.
Eric wrote I think your link is incorrect
on 01-18-2008 2:28 PM
http://www.cruisecontrol.net is NOT the site you want to link to. I think you want: http://ccnet.thoughtworks.com/

Unless this whole post is sarcasm.
Keith Brown wrote re: Turning on cruise control
on 01-18-2008 3:25 PM
SM: yep, we did consider TFS, but given the small amount of projects we work on, it's a bit overkill for us. We also teach classes on BizTalk, but we don't necessarily use it to run this website :) Use the simplest tool for the job - that's my motto.

Eric: thanks for catching the incorrect link. I've fixed it.
Eric wrote re: Turning on cruise control
on 01-18-2008 5:30 PM
My pleasure. Thanks to this blog entry itself, I will be giving CC.Net a try and, hopefully, putting it into play at the company I work for.

Keep up the great work!
ryan wrote re: Turning on cruise control
on 01-18-2008 9:42 PM
There is a useful utility for configuring your ccnet projects called CCNetConfig available on codeplex @ http://codeplex.com/ccnetconfig. No need to manually edit the ccnet.config xml file.
Sergey Pashin wrote re: Turning on cruise control
on 01-18-2008 11:07 PM
Hi Keith,

Our Parabuild might be worth a look. It takes 5 minutes to set up and it works with NAnt and Subversion out of the box.

Sergey
Keith Brown wrote re: Turning on cruise control
on 01-19-2008 4:42 AM
Eric: good luck with your ccnet install!

Ryan: thanks for the link. I noticed that ccnetconfig existed, but I'm the kind of guy who likes to learn how a thing works before putting a thing on a thing if you know what I mean. Now that I've gotten my head around ccnet's basics, perhaps it's time to put some tooling on top of it. I'll give ccnetconfig a try.
Marc Holmes wrote re: Turning on cruise control
on 01-21-2008 3:02 AM
Hey - I know a great book on CCNet and NAnt - my own of course!

http://www.amazon.com/Expert-Delivery-Using-CruiseControl-NET-Experts/dp/1590594851

I loved NAnt and CCNet that much!
Chalkait wrote re: Turning on cruise control
on 02-13-2009 5:57 AM

Hi ,

I am having a similar problem.My ccnet (console)works but ccservice is not making the build.The error is

ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control operation failed: svn: Connection closed unexpectedly

. Process command: c:\program files\subversion\bin\svn.exe log svn+ssh://kalyanradhakrishnan@projects.tfn.com/svn/t1sslink/WQAConsumer/Outpost -r "{2009-02-13T10:32:07Z}:{2009-02-13T12:49:32Z}" --verbose --xml --non-interactive

Can you help?