Welcome to blogs.conchango.com Sign in | Join | Help

Welcome to blogs.conchango.com

James Dawson's Blog

TeamBuild Plug-in for CruiseControl.NET

I've been meaning to write this post for a couple of months now as a follow-up to a session that Colin and I gave at the Microsoft Architect Insight Conference back in March, but just haven't found the time... at least, that's my excuse - anyway cutting to the chase!

Since the release of Team Foundation Server (TFS) there have been several Continuous Integration add-ons produced by various folks:

We've used most of the above, but despite however well they worked have found myself wanting some feature or other that was available in CCNet (actually it more about being badgered by developers about the missing features!).  Whilst some of the above could have been extended to support these features, I couldn't help but feel that this would have been reinventing the wheel - hence the idea to extend CCNet.

By the time I started this Vertigo had already released the VSTS plug-in for CCNet (which is a CCNet source control plug-in), so it was just a matter of producing a CCNet task plug-in that was able to trigger a Team Build.  The guts of calling the Team Build web service I based on the original CI Sample, but I was also keen to provide a mechanism for customising the behaviour of a Team Build in a more dynamic way than just creating another build type and changing the MSBuild properties.

Team Build provides a mechanism for passing custom MSBuild properties into it via a source controlled file called TFSBuild.rsp.  This file consists of 1 or more lines each containing a valid MSBuild commandline switch (e.g. /p:PropName=value, would set the property 'PropName' to be 'value').  With that in mind, I developed the plug-in to allow these switches to be specified in the CCNet server configuration file (on a per CCNet project basis) and have it update the '.rsp' (in source control) before calling the build web service.

I'll hold off diving into any more detail at this point, but if there is interest out there then I can do a follow-up.

Attached to this post should be the plug-in assembly which you need to copy into your CCNet 'server' directory (along with the VSTS plug-in referred to above), and below is a configuration excerpt that shows how to configure the 'teambuild' task in CCNet.

<project name="TeamBuild_CI">

  ...

  <tasks>

    <teambuild>

      <tfsServerUri>http://MyTfsServer:8080</tfsServerUri>

      <teamBuildServer>MyBuildServer</teamBuildServer>

      <teamProject>MyTeamProject</teamProject>

      <teamBuildType>MyTeamBuildType</teamBuildType>

      <workspace>MyBuildServer_MyTeamProject_MyTeamBuildType</workspace>

      <dropsLocation>MyDropsArea\MyTeamProject</dropsLocation>

      <msBuildParameters>

        <MsBuildParameter>/v:d</MsBuildParameter>

        <MsBuildParameter>/logger:ThoughtWorks.CruiseControl.MsBuild.XmlLogger,ThoughtWorks.CruiseControl.MsBuild.dll;msbuild-output.xml</MsBuildParameter>

        <MsBuildParameter>/p:SkipInitializeWorkspace=true</MsBuildParameter>

        <MsBuildParameter>/p:SkipGet=true</MsBuildParameter>

        <MsBuildParameter>/p:SkipClean=true</MsBuildParameter>

        <MsBuildParameter>/p:SkipDropBuild=true</MsBuildParameter>

      </msBuildParameters>

      <useMsTest>true</useMsTest>

      <useMsTestCodeCoverage>true</useMsTestCodeCoverage>

    </teambuild>

  </tasks>

  <publishers>

    <merge>

      <files>

        <file>C:\MyTeamBuildWorkspacePath\MyTeamProject\MyTeamBuildType\BuildType\msbuild-output.xml</file>

      </files>

    </merge>

    <xmllogger>

      <logDir>.\Web\Logs</logDir>

    </xmllogger>

  </publishers>

  ...

</project>

Let me know if you find it useful, interesting or a waste of your time! (actually, maybe save your bandwidth in the case of the latter).

 

Published 24 May 2007 00:46 by james.dawson
Attachment(s): ccnet.teambuild.plugin.zip

Comments

 

john.rayner said:

We're using this on my project.  I have to say that it works and it works well.  Our developers found it easier to read a CC.Net build report than the Visual Studio build reports, especially when they had to fix a broken build.  This CC.Net seamlessly pulls all build logs, test results, etc out of Team Build and into CC.Net.  Nice one!

May 29, 2007 01:41
 

ccnetconfig said:

This seems like it can be a very useful plugin. I have added support for this plugin in CCNetConfig (http://codeplex.com/ccnetconfig) and will be available in the next build. One suggestion I would have is to make the path to the tf.exe configurable. At my work for example, our Program Files directory is on the D drive.

Great plugin

June 10, 2007 01:40
 

Buck Hodges said:

I ran across the following post by James Dawson and thought it may be of interest to folks trying to

August 7, 2007 19:47
 

aleichtle said:

I ran into the following exception using the plug-in for building and wanted to know if anyone else has experienced any similar issues.  If so, can you lead me towards what I am missing?  

ThoughtWorks.CruiseControl.Core.Config.ConfigurationException: Unable to instantiate CruiseControl projects from configuration document. Configuration document is likely missing Xml nodes required for properly populating CruiseControl configuration.Cannot convert from type System.String to ThoughtWorks.CruiseControl.Core.ITask for object with value: "http://r-dev-w03:8080r-dev-wxpTeamBuildExampleCCNetR-DEV-WXPr-dev-wxp\AutoBuild/v:d/logger:ThoughtWorks.CruiseControl.MsBuild.XmlLogger,ThoughtWorks.CruiseControl.MsBuild.dll;msbuild-output.xml/p:SkipInitializeWorkspace=true/p:SkipGet=true/p:SkipClean=true/p:SkipDropBuild=truefalsefalse"

August 29, 2007 00:37
 

mRg said:

Im having exactly the same issue / error message as aleichtle .. anyone have any clue how to fix this ?

September 28, 2007 13:54
 

Omid said:

Hi James,

Would you be able to post a complete ccnet.config entry for this?  I mean have the other xml nodes inside the <project name ...></project>

I am having some problem getting this to work in my environment and wanted to see what you have.

Thanks

Omid

October 15, 2007 23:58
 

WBowsher said:

I was wondering if it would be possible to recompile the plug-in with the latest version of NetReflector in the latest release of CruiseControl.NET, I believe this would be V1.0.0.120 of Netreflector

regards

Bill

November 2, 2007 09:37
 

clively said:

WBowsher:

I used Reflector from http://www.aisto.com/roeder/dotnet/ to decompile the code.  Then I just created a brand new assembly with updated references.

It took about an hour to do.

Although it would be nice if James would put the code up on CodePlex.

Chris.

November 7, 2007 20:27
 

mRg said:

I also used reflector in the end .. first to update the reference and then to fix the fact it is sensitive to spaces in the build/project names which was the issue I was having. Would be nice to be able to post my little fix as this code is now a key part of our internal CI solution (Big thanks James now just pop it on codeplex !!)

November 10, 2007 19:31
 

james.dawson said:

I've finally gotten around to making the arrangements to get this plug-in moved to CodePlex - I should have some news in the next few days.

Cheers, James.

November 24, 2007 22:26
 

Buck Hodges said:

James Dawson previously posted a plugin for CruiseControl.NET that provided a continuous integration

November 26, 2007 14:21
 

Noticias externas said:

James Dawson previously posted a plugin for CruiseControl.NET that provided a continuous integration

November 26, 2007 15:14
 

GrabBag said:

This post was originally published here . Team Build 2005 did not support Continuous Integration out

March 27, 2008 22:29
Anonymous comments are disabled
Powered by Community Server (Personal Edition), by Telligent Systems