从 Subversion SVN 标记触发的 Team Foundation Server TFS 构建

Team Foundation Server TFS Build triggered from Subversion SVN Tag

当开发人员在 Subversion 中添加标签时,我希望能够在 TFS Build 中触发构建。我还想将标签号用作构建和发布名称的一部分。现在在 TFS 中这可能吗?

没有此 built-in 触发器用于在 TFS 中构建存储库类型的颠覆。

您可以先从 SVN 获取事件(开发人员在 svn 中创建标签)。不确定如何在 SVN 中执行此操作,应该类似于 service hooks in TFS. Then trigger a build in TFS 2017 using REST API. How to do this please refer:

至于如何使用标签号作为构建和发布名称的一部分,请参见下文:

Create custom build number during build

With Team Build you can update the build number at any time during the build by outputing "##vso[build.updatebuildnumber]1.2.3.4" to the log during the build.

You can see the full list of logging commands here https://github.com/Microsoft/vso-agent-tasks/blob/master/docs/authoring/commands.md

This will update the build number & name.

The down side that you have run into is that you can no longer use the auto-incrementing number that you have been trying to use. You need to come up with the version number yourself, and then pass it back using the output above.

Source

再添加两个相关博客: