Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the sources from the branch that triggered the build in Team Services

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?

like image 922
Thomas Schneiter Avatar asked May 23 '17 11:05

Thomas Schneiter


People also ask

How do you trigger a build on Azure DevOps pull request?

Create a pull request trigger You can set up pull request triggers for both Azure Repos or GitHub repositories. From within your project, Select Pipelines > Releases, and then select your release pipeline. Under the Pull request trigger section, select the toggle button to enable it.

How do you trigger a release pipeline from another release pipeline?

When you have installed the extension, you can start by altering a pipeline from where you want to trigger a different pipeline. Add a new task to the pipeline by clicking in “+” icon. In the task window search for “Trigger” and select the task “Trigger Azure DevOps pipeline”.

What are triggers in Azure DevOps?

Scheduled release triggers allow you to run a release pipeline according to a schedule. Pull request release triggers are used to deploy a pull request directly using classic releases. Stage triggers in classic release are used to configure how each stage in a classic release is triggered.


1 Answers

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.

like image 194
Luca Cappa Avatar answered Oct 17 '22 07:10

Luca Cappa