如何配置 TFS 为每个 pull 请求(创建和更新时)运行构建(这是 CI 构建)。
我想要的场景是,当开发人员完成其工作并将分支推送到 GIT(在 TFS 上)时,最好检查构建是否实际编译以及所有测试是否通过。
我可以为现有的分支创建一个构建并监视那里的更改,但如何为稍后创建的分支配置它,以及如何在创建 pull 请求时触发此构建。
最佳答案
您可以在分支名称中使用通配符。因此,如果您在服务器上使用命名模式(例如“pr-myrequest”)创建 pull 请求分支,则可以将其添加到服务器的 CI 设置中:
关于这个主题有一些简介in the guidance on MSDN .
Git: Specify the repository and the branches that contain the files that your build process requires.
block 引用>Tip
In the list of branches monitored for continuous integration (CI) and rolling builds, you can use wildcards. For example, you could specifyrefs/heads/feature*
to monitor therefs/heads/featureA
andrefs/heads/featureB
branches.您可以使用
/
在分支命名中,可以提供一种清晰的方式来命名分支。这将导致:refs/heads/pr/*
作为包含,您的分支名称必须以pr/branchname
开头。自动构建。
关于git - Team Foundation Server 2013 触发器构建 pull 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28897978/