13

I have a repository in VS Team Services which is setup as :

-root
 |
 | -Dev (.sln)
 |
 | -Releases
     |
     | - Test (.sln)
     | - Live (.sln)

Each build is working fine, however its pulling the entire repo and I just want it to pull a specific branch (Dev, Test or Live)

So I'm selecting the Solution.sln file in the dev branch...

Screen shot of VSO

Community
  • 1
  • 1
MiloTheGreat
  • 710
  • 7
  • 14

1 Answers1

14

On the Repository tab you can specify your workspace mappings, the default mapping grabs your whole repository excluding the $/project/drops folder.

By changing the first mapping to not take $/Project, but $/project/dev you'll limit the scope of the get operation. If you no longer get the root of your team project, you can remove the cloak of the drop folder, that will only raise a warning otherwise:

enter image description here

The next thing you should do, if you're setting this build up to be a CI build, it to specify the folders that will trigger this build on the Tiggers tab, because, again by default, CI builds will trigger on any change in the whole team project.

enter image description here

To allow you to keep your build definition as a template, I suggest to use the $(Build.SourcesDirectory)\MySolution.sln instead of $/project/dev/Mysolution.sln, that way you only need to update the mappings of a build definition after cloning it to another branch root or when saving it as a template.

enter image description here

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
  • 1
    Thanks for that. That really explains a lot. – MiloTheGreat Jan 09 '16 at 10:37
  • I think I'm getting to a root cause though... my sln file is not being pulled to the build agent. I've looked the VSOwork folder and everything is there but the sln file.... "Cannot find path 'F:\vsowork\1\s\xxxxx.sln' because it does not exist." I also tried your approach as above, which is correct. – MiloTheGreat Jan 09 '16 at 10:40
  • Can you share a screenshot of the Source Control Explorer to show which files are in the dev folder? And of the mapping of your build definition? – jessehouwing Jan 09 '16 at 11:46