TFS - 通过 运行 构建依赖它的项目来测试通用模块

TFS - testing a common module by running builds of projects that depend on it

我正在使用:

Microsoft Visual Studio Team Foundation Server
Version 16.131.28507.4

我有一个 Git maven Java class 库,它在 TFS 中构建并发布到 Artifactory。

我有几个其他项目依赖这个 class 库。

所以当有人在我的 Git maven Java class 库中针对我的主要分支创建 PR 时,我想从其他一些项目中进行一些冒烟测试在允许合并 PR 之前成为 运行 的先决条件。

Repository Settings -> Branches -> Protect Branch - require task to pass before PR merge 中有一项功能。但问题是这项工作 运行s 在发布到我的共享库到 artifactory 之前,我无法拉出我的新依赖项。

我期待像 Jenkins 那样的东西,在那里你可以 运行 另一个项目的构建任务。但是TFS里面好像没有。

而且我尝试拉出 powershell 并通过脚本执行此操作,但是当您尝试 git 时冻结。

有什么方法可以做我想做的事吗?

I expected something like Jenkins has, where you can run another project's build task. But it doesn't seem to exist in TFS.

是的,我们无法在当前 PR 构建验证中 运行 另一个项目的构建管道:

但我们可以创建一个构建管道来调用 REST API Builds - Queue:

POST https://{instance}/{collection}/{project}/_apis/build/builds?api-version=4.1

触发另一个项目的构建管道,并使用Builds - Get检查该管道的结果。

接下来,我们使用logging commands根据触发的管道结果设置当前构建结果。

##vso[task.complete result=Succeeded;]DONE