User101
User101

Reputation: 858

Prevent TFS Build Definition Source Settings from triggering a build

When I create a build definition I have setup some source settings, example below:

enter image description here

Problem is I want it to trigger a build when someone checks into the Builds or Install folders, but the Includes folder is just some libraries and other items it needs. I don't want it to re-run when these libraries are changed. However I need to set them up here to make sure they are copied across to the Build drop server. Is there a way to copy across this Includes folder without forcing a build trigger when someone checks in to this folder?

Upvotes: 1

Views: 839

Answers (3)

Just TFS
Just TFS

Reputation: 4787

There are 2 things to do to approach this.

First you need to get your source folders into a build centric layout, this will help to eliminate as much overlapping as possible.

If you need a particular shared folder that shouldn't trigger a build, then don't include it in the source mappings, instead add a script to download the files to your workspace as an early part of the build.

The example will need updating for your visual studio version, and you should pass the sources Directory to the script.

   REM %1 represents the Sources directory
   REM Compute variables
   SET TfExe="%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\IDE\TF.exe"
   REM SET TfExe="C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\TF.exe"
   Set RefPath="$/TFS BUILDS/Shapes/Main/Includes"
   Set localPath="%~1\Includes"

   REM set the Drive Letter for this build
   Set Localdrive=%localPath:~1,2%
   %Localdrive%
   cd %1

   REM Map the folders 
   %TfExe% workfold /map %RefPath% %localPath%

   REM Get the required content
   %TfExe% get %RefPath%

   REM Unmap the folders 
   %TfExe% workfold /unmap %RefPath%

Upvotes: 1

d3r3kk
d3r3kk

Reputation: 4065

Use the special keyword ***_NO_CI*** in your checkin into the Includes directory.

See this post for further details.

Upvotes: 1

Dylan Smith
Dylan Smith

Reputation: 22255

There is no easy way to do this. As you've discovered, the source settings do double-duty, they define the set of files needed for the build that are downloaded and the set of files that trigger a CI.

I would argue this isn't a problem, if the Includes are used in your build, then I would want to kick off a new build when they change, to ensure that the change didn't break anything in the build process.

Upvotes: 1

Related Questions