Azure DevOps, Scrum, & .NET Software Leadership and Consulting Services

Free course! Predicting the Future, Estimating, and Running Your Projects with Flow Metrics

Updated Continuous Integration Service for TFS 2005 / Team Build 2005


You’re probably familiar with the Khushboo Continuous Integration Service for Team Foundation Server 2005 & Team Build 2005. 

I’ve been using it for a long while now but recently ran up against a limitation: you can’t specify a build per source control sub-directory — you can only specify continuous integration builds at the Team Project level.  Put another way, if you check in a file anywhere in your team project it kicks off the build and I needed it to kick off a specific build whenever the code was checked in to a certain directory.

In the service, the builds are configured inside of web.config using numbered builds (key=”1″, key=”2″, etc) with name-value pair configurations.  I added support for a new value called PathToBuild.

<appSettings>
  <add key=”LogFileName” value=”CI-log.txt”/>
  <add key=”TeamFoundationServer” value=”http://labtfs:8080″ />
  <add key=”ServerUrl” value=”http://labtfs” />
  <add key=”1″
    value=”TeamProjectName=Agile Team Project;BuildType=Default Build;
     PathToBuild=$/Agile Team Project/Main/Demo20071030″ />
  <add key=”2″
    value=”TeamProjectName=Agile Team Project;BuildType=Branch Build;
     PathToBuild=$/Agile Team Project/Branches/Demo20071030″ />
</appSettings>

PathToBuild indicates the source control path that will trigger the build. 

Changes from the Khushboo Version:

  • In order to make setup easier, I added a batch file to run the bissubscribe.exe registration script.  Edit this script with the name/address of your TFS instance and then run the file.  That should be all you need to do to register the service with TFS. 

    If you already have the Khushboo version installed, delete the contents of your CI directory and replace it with my code. 

  • Refactored the CI classes into their own files.  Moved the CheckInEvent class to a new project called ContinuousIntegration.Business. 
  • Added a new ContinuousIntegration.UnitTests project with a handful of unit tests.

Deployment instructions:

  • Download the zip file (see below) to your TFS machine
  • Unzip the files
  • Open explorer.exe and go to
    C:Program FilesMicrosoft Visual Studio 2005 Team Foundation ServerWeb Services
  • Copy the “CI” from the zip file to the
    C:Program FilesMicrosoft Visual Studio 2005 Team Foundation ServerWeb Services directory
  • Open the IIS Manager, find the CI folder.  Right-click, go to Properties, click the “Create Application” button, then set the AppPool to be “TfsAppPool”
  • Modify the web.config file in
    C:Program FilesMicrosoft Visual Studio 2005 Team Foundation ServerWeb ServicesCI to point to your TFS instance
  • Modify the web.config file to point to your desired source folder and build
  • Go to the unzipped code files and locate “bis_ci_build.bat”.  Open it with notepad and change the /address portion to point to your TFS instance
  • Run bis_cit_build.bat
  • You’re done.

Click here to download the code & binaries.

-Ben

 

— Need help setting up Team Foundation Server and/or Visual Studio Team System?  Need training on VSTS and TFS?  Want help configuring your source control, work items, and Team Builds?  Contact me via http://www.benday.com.

SUBSCRIBE TO THE BLOG


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.