Monitoring multiple VSS projects in CruiseControl.NET

One of the most useful techniques I have found in working with CCNet and VSS is the ability to monitor multiple VSS project folders to trigger a build. Many times, you will find your solution structured such that monitoring a top level folder may not be the right level for triggering a build. If this is your problem, then <sourcecontrol type=”multi”> might just be your solution.

Here is a simple example of how you can monitor multiple projects within VSS to trigger a Visual Studio build to happen:

<project name="MySoftware">
        <workingDirectory>C:\Dev\ProjectXYZ\4.0\GUI</workingDirectory>
        <modificationDelaySeconds>10</modificationDelaySeconds>
        <sourcecontrol type="multi">
            <sourceControls>
                <vss>
                    <executable>C:\Program Files\Microsoft Visual SourceSafe\SS.EXE</executable>
                    <project>$/Dev/ProjectXYZ/4.0/GUI</project>
                    <username>BuildUser</username>
                    <password>BuildPassword</password>
                    <ssdir>\\server\share\vssdir\</ssdir>
                    <workingDirectory>c:\dev\projectxyz\4.0\GUI</workingDirectory>
                    <cleanCopy>true</cleanCopy>
                </vss>
                <vss>
                    <executable>C:\Program Files\Microsoft Visual SourceSafe\SS.EXE</executable>
                    <project>$/Dev/Shared/ComponentABC/5.1</project>
                    <username>BuildUser</username>
                    <password>BuildPassword</password>
                    <ssdir>\\server\share\vssdir\</ssdir>
                    <workingDirectory>c:\dev\shared\componentabc\5.1</workingDirectory>
                    <cleanCopy>true</cleanCopy>
                </vss>
            </sourceControls>
        </sourcecontrol>
        <tasks>
            <devenv>
                <solutionfile>MySoftwareSolution.sln</solutionfile>
                <configuration>Release</configuration>
                <executable>C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe</executable>
            </devenv>
        </tasks>
    </project>

In this example, we are watching for code changed in either ProjectXYZ or shared ComponentABC. Monitoring recursively for any changes below $/Dev may cast much too large of a net to effectively limit the number of CI builds triggered.

Another useful application mentioned on the CruiseControl.NET documentation for this feature is that you can monitor different types of repositories, including a filesystem. So if you have some dependencies that you want to rebuild with that get posted to a file server, this can trigger a build based on changes there as well.

6 Responses

  1. Scott,

    Our Parabuild may be worth a look as well. It supports multi-line VSS paths and it is much easier to configure: all configuration is done through a Web UI.

    Serge

  2. Interesting post – I’ve tried doing exactly that and had some glitches depending on which version of CC.Net is deployed (one of them threw errors if you had more than 2 vss elements in a multi source).

    I’m wondering if you’ve spotted any easy way to trigger a build if “the solution or any of its referenced files” changes (IE. automatically check all projects included in a solution)… rather than hard-configure each and every project. I ask because I’m working on a hefty enterprise deployment that currently has 50+ projects in the one solution, and new projects get added/changed periodically. It would be nice to keep the CC.Net config simple instead of hard-configuring each project and then having to maintain that config whenever anything changes… anything short of changing the CC.Net source & redeploying spring to mind?

  3. Scott & Sam,

    I was also looking for a way to trigger a build if any of the projects in the ‘solution’ has changed.

    I want to mimic the behavior from the VS2005 GUI of ‘Get Latest Version(Recursive)’ to simplify the business of version controll items in the ccnet.config file.

    Keeping up with multiple tags in a dynamic development environment can be a grind sometines.

    I will keep looking, but post back if you know of a solution.

    Thanks.

  4. That would be pretty sweet. Unfortunately, I am not aware of something like that but I’ll keep an eye out.

    I guess it would have to be some sort of a plug-in that knows how to interpret the contents of a VS .sln file and use that as the driver instead of the static contents of the CCNet.config.

  5. I’m using vss on a server that isn’t in mydomain, and ccnet requieres to access to the folder where is .ini and i haven’t permissions for that folder, if someone knows the answer….

  6. You will certainly run into problems if your CI server can’t access your source control repository. Even if it is not in the domain, you should be able to access the .ini file. Do you know the IP address of the VSS server? If so, you can use that to access the share. You may want to setup a persistent drive mapping so that you can lock in some credentials for when the source control operations are run by CCNet behind the scenes.

    Feel free to ask more detailed questions if you can’t get it. There should be no reason I can think of why this would not be possible (and I have done it before).

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: