Wors World
All About Wor

Subversion, Cruise Control, NUnit & MSBuild

DRAFTED on November 30 but not published until now…….
 
I’m currently employed as a .Net development consultant for a large telecomms company.  There’s me and another guy who have been drafted into develop a publish/subscribe system, allowing messages to be published from publishing applications to any subscribed servers.
 
We’re developing from 2 separate locations in the UK and currently don’t have access to the telecomms companys infrastructure, thereby making it hard to develop code concurrently – we’ve been emailing source to each other :-(.
 
I’ve decided that until we get access to the companys source control system, I’ll setup Subversion (SVN) to host our code and use Cruise Control (CC) , NUnit & MSBuild to provide us with an centralised, automated build environment.  They’re all products that, individually, I’ve had a lot of experience with but until now I’ve never tried to automate builds out of SVN.  They’re all free thanks to the Open Source effort.
 
The process of installing and configuring appears to be well documented so wont be repeated here, instead, I’m looking to document the issues that I had after installation……
 
I logged onto a server that was hanging about in the office not doing a great deal and I started by downloading and installing the latest version of SVN (source code repository), TortoiseSVN (sourec code repository client accessible from Windows Explorer)  and VisualSVN.  For all the products it was a simple matter of run setup, click Next, click Next, Finish and went really well.  I used the VisualSVN Server Manager and created myself a repository, added users and groups and added them to the repository.
 
I accessed the url where VisualSVN Server Manager had created my repository and had to install the certificate that the installation process had installed for me (it’s a self signed, non trusted cert).
 
Next, I downloaded and installed CC.  I got into the ccnet.config and setup the relevant sourcecontrol and msbuild sections.
 
I switched to my dev machine and installed VisualSVN with VS integration.  Opening my solution I added it to the SVN repository I had created earlier.  Switching back to the build server, I checked the CC log (ccnet.log) and saw:
 

ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control operation failed: svn: OPTIONS of ‘https://myservername:8443/svn/MySolution’: Server certificate verification failed: issuer is not trusted (https://myservername:8443)

 
I puzzled over this for a while as I was thinking "I’ve installed the cert – what’s wrong with it?".  I didn’t puzzle for long though as I had a social event to get to :-).
 
Returning to this, I Googled ths issue and discovered (much to my embarassment) that I’d only installed the cert for my user only – Cruise Control was running as a server with local system as it’s user.  I decided to setup a new user to run the service under and changed the logon details of the service.  I ran IE as this user and installed the cert for this user.  I also created a new Subversion user and added it to the root Subversion repository.
 
Restarting the service fixed the error but then I came up against this:
 

ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control operation failed: svn: OPTIONS of ‘https://myservername:8443/svn/MySolution: authorization failed (https://myservername.local:8443).

 

Checking the sourcecontrol tags details with the Cruise Control documentation resulted in me modding the sourcecontrol tag in ccnet.config to add user id and password attributes:

 

<sourcecontrol type="svn" username="MyServiceAcc" password="xxxxxxx">

 

This resulted in another error

 

ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control operation failed: svn: Server sent unexpected return value (403 Forbidden) in response to OPTIONS request for ‘https://myservername:8443/svn/MySolution&#8217;

. Process command: svn.exe log https://myservername:8443/svn/MySolution -r "{2008-11-29T17:06:33Z}:{2008-11-30T17:07:01Z}" –verbose –xml –username MyServiceAcc –password xxxxxxx –non-interactive –no-auth-cache

 

Googling again brought me more info and I gave the CC service user full control to the directory where Subversion deploys the repositories.

 

Still not fixed.

 

I took the command line that CC creates for the sourcecontrol task and changed it to use my credentials – it worked.  I spent another half hour or so changing the password of the SVN user which CC runs as without fixing the problem (it must be permissions related) before deciding to add my credentials to the ccnet.config – NOT BEST PRACTICE!  I’ll look at this again when I get it all working :-).

 

On to the next issue:

 

ThoughtWorks.CruiseControl.Core.CruiseControlException: Unable to load the output from svn: <?xml version="1.0"?>

<log>

<logentry

   revision="11">

 

This turned out to be a known issue that has been fixed :

 

http://confluence.public.thoughtworks.org/display/CCNET/Welcome+to+CruiseControl.NET

 

so I downloaded it and installed it and it went away.

 

I also installed the SMTP component of IIS to allow the CC config to send email results of the build – not really needed as CC comes with a utility (CC Tray) which allows you to monitor the state of the builds on the build server but I thought I’d do it anyway in case we ever meet a need to support interested parties who don’t want the tray.

 

I had to forward port 8443 through the Belkin router to allow external access to Subversion and that was that – internal and external access to Subversion and continuous integration up and running.

 

Since I drafted this I’ve used this setup for a number of other development projects and it’s great – simpler and lighter than Team Foundation Server (which I will return to at some point).  It’s ran without a blink since then ……

Advertisements

One Response to “Subversion, Cruise Control, NUnit & MSBuild”

  1. Hi Buddy, I got the "Server certificate verification failed: issuer is not trusted" for the same reason you did, so reading your blog helped me out.Thanks!Anders, Denmark


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: