Search code examples
deploymentcontinuous-integrationtfsbuildalm

Build Workspace mapping


I got two solution setting at same location. This two solution are sharing some of the projects along with some dedicated ones.

I have created two separate build definition with gated check in trigger but issue is that when I make any change in one solution it triggers both the build definition.

Can I somehow control the triggering of the build definition based on the solution that I am checking in?


Solution

  • You need to configure your workspace correctly for this to work. Any change in a Build definition's mapped workspace will cause a build to trigger. Due to this, it completely depends on your source control layout, whether it's possible to setup a build that only triggers when something changes that belongs to either solution.

    This setup will become very hard to manage quite quickly, as such I recommend you put each set of projects in their own subfolder, that makes it a lot easier.

    So ensure that you build definitions won't both trigger, open the Source Settings panel of your build definition and apply a cloak rule to each file or folder by changing "active" in the first column to "cloaked".

    To cloak a file you need to enter its full path in TFS, the UI will only offer you a folder picker, but entering a path to a file will work.

    These files should:

    • Not be needed to build the solution
    • and changes to should not trigger the build.

    Do note that the cloak will cause Team Build to not get these files on the Build agent, so it's not possible to have files your build depends on, but not trigger the build when these files change.