问题
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:
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):
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?
回答1:
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.
来源:https://stackoverflow.com/questions/44133816/get-the-sources-from-the-branch-that-triggered-the-build-in-team-services