9

I would like to create an integration build in VS Team Services, that is triggered when a commit is done to any branch (develop/feature xy) except master.

I am able to create a trigger for this:

enter image description here

but how do i checkout the sources of the branch that triggered the build?

In the task tab, the first step is 'Get Sources' and here i'm only able to choose one branch (the * wildcard is not possible here):

enter image description here

Otherwise for example a build is triggered by a feature branch, but the sources are taken from the develop branch. How can i do this?

Thomas Schneiter
  • 1,103
  • 2
  • 19
  • 35

1 Answers1

14

You filter is perfectly fine if you want to build anything but master branch.

The branch you select in build definition is just the default branch used when you Queue New Build manually.

OTOH the build trigger establish which branch to download, e.g. if the build has been triggered by a git push on branch develop then that is the one checkout'ed and built.

When you queue a new build manually, you also have the chance to change the default value to whatever branch you would like to build.

Luca Cappa
  • 1,925
  • 1
  • 13
  • 23
  • 2
    I've just checked this and you're absolutely correct, thank you! They should probably make it more obvious that this is just the default branch and the trigger is actually the branch being checked out. – Thomas Schneiter May 23 '17 at 13:04
  • Agree with @Eric. All they have to do is add the word "Default" to the "Branch" label in Get Sources, and all would be fine. – pabrams Jul 29 '19 at 17:52