从触发Team Services构建的分支获取源 [英] Get the sources from the branch that triggered the build in Team Services

查看:50
本文介绍了从触发Team Services构建的分支获取源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在VS Team Services中创建一个集成构建,该构建在对master以外的任何分支(develop/feature xy)进行提交时触发.

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):

否则,例如,构建是由功能分支触发的,但是源却是来自develop分支的.我该怎么办?

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?

推荐答案

如果您要构建除master分支以外的任何内容,则过滤器非常好.

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

您在构建定义中选择的分支只是手动对新构建进行排队时使用的 default 分支.

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

OTOH构建触发器确定要下载的分支,例如如果构建是由分支develop上的git push触发的,则这是一个已签出并构建的项目.

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.

这篇关于从触发Team Services构建的分支获取源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆