ChrisLively
ChrisLively

Reputation: 88064

How to limit TFS 2008 CI Build to a particular path in the project

If you follow some of MS's recommended branching strategies you can easily end up with a project structure such as:

$PROJECT\
    DEV\
        MyProject
    STAGE\
        MyProject
    PROD\
        MyProject

Now let's say I have three different build definitions. One each for DEV, STAGE, and PROD. This should be common considering that the build definition will define the exact solutions to build.

If I turn on CI for each of them, STAGE will be built even though the checkin occurred in DEV...

Now my question. How can I limit the build definition to execute only when a check in occurs in either a path or a solution that is part of the build definition?

Upvotes: 1

Views: 455

Answers (1)

Martin Woodward
Martin Woodward

Reputation: 11770

When defining the working folder configuration screen - only have it start at the root of the branch you want to build.

For example, your DEV branch would be configured so that $/TEAMPROJECT/DEV/MyProject was mapped to $(SourceDir) rather than the default mapping which would have been set to just $/TEAMROJECT.

FYI - Personally, I only have CI Builds on Dev branches and queue manual builds for a push to QA. I also normally don't do a re-build for production but just push the build binaries that were QA'd. I also keep by build configuration folder inside the branch i.e. $/TEAMPROJECT/DEV/TeamBuild rather than the default $/TEAMPROJECT/TeamBuildTypes and therefore changes to the build configuration are also pushed up through the branches. That said, you have to stick with the default if you wanted the build configuration to be visible to VS2005 clients.

Hope that helps,

Martin.

Upvotes: 1

Related Questions