我有 2 个构建定义,其中 TFS 中有 2 个代理单独运行。使用一个构建一代理运行构建。其中一个构建应该在另一个构建完成时开始,因为第二个构建使用第一个构建结果。第二个版本应该在单独的机器上运行,因为它有我在第一台机器上没有的特定要求。 我做了一些搜索,发现关于 tfs 构建触发器的信息很少。我希望当第一次构建完成时我可以触发第二次构建。这是可能的??? 我正在使用 TFS 2017 更新 2。
最佳答案
您想要做的是链接构建(一个构建调用另一个构建定义)。
官方尚不支持此功能。还有一个相关的用户声音,并且处于计划状态:
Provide build configuration dependencies in TFS Build
Provide the ability to create build configuration dependencies such that the success of one build configuration can trigger another build configuration such as a successful build triggering the building of an installation package or a build configuration which deploys to a development or staging server.
目前,您可以使用 Rest API 调用另一个构建定义并触发构建作为解决方法。有一个custom build task由 Benj Huser 编写,它确实完美地完成了工作。有关更多详细信息,请查看他在这个问题中的回答:How to chain builds in TFS 2015?
关于tfs - 定义 TFS 构建定义依赖性和顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46928404/