My goal is to create a TFS CI Build that is triggered by check-ins on two specific branches of a project, hosted in TFVC. When I queue the build manually and type a specific branch in the "Shelveset name" field of the queue prompt, the build works as intended. However, when I check in changes from one specific branch, the build attempts to use the parent folder of the two branches as its default source, resulting in incorrect file paths throughout the build definition wherever I use the $(Build.SourceBranchName)
variable.
My folder structure is as follows:
- $/MyRepo
|
| -Integration Suite
|
| -CurrentVersion
|
| -Dev
I have CI triggers turned on with path filters to include $/MyRepo/Integration Suite/CurrentVersion
and $/MyRepo/Integration Suite/Dev
In the "Get Sources" task, my repository is set to $/MyRepo
, and I map these server paths to the CurrentVersion
and Dev
local paths, respectively.
I would expect, for example, that checking in changes under the CurrentVersion
branch would set the source of the build to $/MyRepo/Integration Suite/CurrentVersion
, but instead it is set to $/MyRepo/Integration Suite
. This means that any paths I build in the definition with $(Build.SourceBranchName)
have Integration Suite
where they should instead have CurrentVersion
.
Am I doing something wrong? Or is my desired behavior not supported?