Wednesday, December 15, 2010

Multiple VSS Projects Using Cruise Control .Net

I'm a big fan of Cruise Control .Net. As an open source continuous integration server, it performs wonderfully and is quite scalable.

Unfortunately, great CI servers can often times be matched with horrendous source control systems. Specifically, the bane of all SCM's, Visual SourceSafe 6.0. My group at work unfortunately is still encumbered by VSS 6.0 for a little while longer until we finally migrate to a proper SCM in 2011. Subversion or Git obviously would get my first vote....but, I digress...

I ran into a little hiccup with VSS on Cruise Control .Net -- some of my assemblies are located in different project locations. I needed to update multiple projects on different locations in the SCM prior to executing the build.

So, how does one properly update multiple projects in VSS for a Cruise Control .Net build? Digging into the CC .Net documentation further, I found that there is an option for a "multi" sourcecontrol block in your ccnet.config file. Using the multi type sourcecontrol block, one can call for multiple updates to different projects on VSS.


Example:



<sourcecontrol type="multi">
<sourceControls>
<vss>
<executable>C:\Program Files\Microsoft Visual Studio\Common\VSS\win32\ss.exe</executable>
<project>$/SampleApplication</project>
<username>VSSUser</username>
<password>VSSPassword</password>
<ssdir>\\SERVERNAME\VSS</ssdir>
<workingDirectory>c:\VSS\SampleApplication</workingDirectory>
<culture>en-US</culture>
<cleanCopy>false</cleanCopy>
</vss>
<vss>
<executable>C:\Program Files\Microsoft Visual Studio\Common\VSS\win32\ss.exe</executable>
<project>$/SampleApplication2</project>
<username>VSSUser</username>
<password>VSSPassword</password>
<ssdir>\\SERVERNAME\VSS</ssdir>
<workingDirectory>c:\VSS\SampleApplication2</workingDirectory>
<culture>en-US</culture>
<cleanCopy>false</cleanCopy>
</vss>
</sourceControls>
</sourcecontrol>

In essence, you are instructing CC .Net to make multiple calls to the SCM (VSS in this case) to grab all pertinent source code prior to your build. This example would obviously also work for other SCM's compatible with CC .Net, such as Subversion.

2 comments:

Unknown said...

Thank you for this. It saved me some time.

Eric Nograles said...

Miscellaneous_9: Glad I could help! I had some trouble finding this too, so I figured a post would help other developers.