将自定义 XAML 构建工作流迁移到 TFS 2017 扩展
Migrate custom XAML build workflow to TFS 2017 extensions
我目前有一个自定义 XAML 构建工作流,它根据代码结构、文件夹、文件内容甚至数据库配置执行大量验证。
目前我们需要考虑将其迁移到 TFS 2017,我正在尝试了解可能性、工作量和陷阱,这就是我需要您帮助的地方。
我在 C# 中构建了逻辑,然后我查看了 MSDN 文档,语言似乎是 Javascript,GitHub 示例似乎是 Typescript。我是否被迫使用其中一种语言?我应该注意的任何首选或限制?例如,我可以直接连接到数据库吗?或者最好有一个 API 并只使用 REST 调用?
例如,我可以使用已经包含一些包装逻辑的 .Net 对象吗?
我还注意到在清单文件中我可以声明输入,但我可以以某种方式使用输出吗?例如,我有一个执行验证的任务,最后我将有一个任务发送一封包含该验证结果的电子邮件。这可能吗?
提前致谢。
这里的问题太多而且范围很广。
无论如何,XAML 构建在 TFS 2017 中已弃用,并且在下一版本的 TFS 中将不可用。 VSTS 已经不再支持它们。所以你需要Migrate from XAML builds to new builds (vNext builds). Also this similar thread for your reference : Converting TFS XAML Build Custom Activities into TFS 2015 Build Tasks
Marketplace
While you can make use of custom build tasks with XAML build there is
no centralized or integrated solution for browsing available tasks,
installing them or managing them. With the new builds you can make use
of the quickly-growing Visual Studio Team Services Marketplace. Here,
you can search and browse the many extensions currently available in
the Marketplace.
See WHY SHOULD I LEAVE XAML BUILDS for details.
因此,您可以在 Marketplace and install them to extend the build process (add correspinding tasks). You can also custom your own extension based on your specific requirements. See Extensions overview 中找到现有的扩展。
You can build custom applications or services that integrate with your
Visual Studio Team Services (VSTS) and Team Foundation Server (TFS)
accounts by using the REST APIs to make direct HTTP calls, or
utilize our .NET Client Libraries.
Source here : Integrating with VSTS and Team Foundation Server
要添加自定义任务,您可以参考以下文章:
- Add a build task
- Reference for creating custom build tasks within extensions
- Developing a Custom Build vNext Task
对于"outputs"验证,你可以用build alerts.
试试
您得出 XAML 版本已弃用的结论是正确的。新的基于任务的系统更加灵活,现在我们甚至有 YAML 支持,您可以转移到代码构建。
您之所以在 TypeScript 中看到构建任务(它是 JavaScript 的超集),是因为 NodeJS 的跨平台特性。这允许您的任务在 Windows、Linux 和 Mac 上 运行。同时 we also got .NET Core support. 如果您更喜欢 PowerShell,您也可以使用它。
关于您的 'can I connect to a database' 问题。是的,你可以,如果你想要这是另一个问题。这将大大减慢您的构建速度,如果数据库连接出现问题,将使您的构建失败。我建议在 Whosebug 上问第二个问题来描述你的情况并讨论是否有更好的选择。
您可以使用任务的输出变量并在下一个任务中重复使用这些变量。这一切都受支持,没有问题(请参阅 https://roadtoalm.com/2016/08/11/set-output-variable-in-a-powershell-vsts-build-task/ 示例)。
我目前有一个自定义 XAML 构建工作流,它根据代码结构、文件夹、文件内容甚至数据库配置执行大量验证。
目前我们需要考虑将其迁移到 TFS 2017,我正在尝试了解可能性、工作量和陷阱,这就是我需要您帮助的地方。
我在 C# 中构建了逻辑,然后我查看了 MSDN 文档,语言似乎是 Javascript,GitHub 示例似乎是 Typescript。我是否被迫使用其中一种语言?我应该注意的任何首选或限制?例如,我可以直接连接到数据库吗?或者最好有一个 API 并只使用 REST 调用?
例如,我可以使用已经包含一些包装逻辑的 .Net 对象吗?
我还注意到在清单文件中我可以声明输入,但我可以以某种方式使用输出吗?例如,我有一个执行验证的任务,最后我将有一个任务发送一封包含该验证结果的电子邮件。这可能吗?
提前致谢。
这里的问题太多而且范围很广。
无论如何,XAML 构建在 TFS 2017 中已弃用,并且在下一版本的 TFS 中将不可用。 VSTS 已经不再支持它们。所以你需要Migrate from XAML builds to new builds (vNext builds). Also this similar thread for your reference : Converting TFS XAML Build Custom Activities into TFS 2015 Build Tasks
Marketplace
While you can make use of custom build tasks with XAML build there is no centralized or integrated solution for browsing available tasks, installing them or managing them. With the new builds you can make use of the quickly-growing Visual Studio Team Services Marketplace. Here, you can search and browse the many extensions currently available in the Marketplace. See WHY SHOULD I LEAVE XAML BUILDS for details.
因此,您可以在 Marketplace and install them to extend the build process (add correspinding tasks). You can also custom your own extension based on your specific requirements. See Extensions overview 中找到现有的扩展。
You can build custom applications or services that integrate with your Visual Studio Team Services (VSTS) and Team Foundation Server (TFS) accounts by using the REST APIs to make direct HTTP calls, or utilize our .NET Client Libraries.
Source here : Integrating with VSTS and Team Foundation Server
要添加自定义任务,您可以参考以下文章:
- Add a build task
- Reference for creating custom build tasks within extensions
- Developing a Custom Build vNext Task
对于"outputs"验证,你可以用build alerts.
试试您得出 XAML 版本已弃用的结论是正确的。新的基于任务的系统更加灵活,现在我们甚至有 YAML 支持,您可以转移到代码构建。
您之所以在 TypeScript 中看到构建任务(它是 JavaScript 的超集),是因为 NodeJS 的跨平台特性。这允许您的任务在 Windows、Linux 和 Mac 上 运行。同时 we also got .NET Core support. 如果您更喜欢 PowerShell,您也可以使用它。
关于您的 'can I connect to a database' 问题。是的,你可以,如果你想要这是另一个问题。这将大大减慢您的构建速度,如果数据库连接出现问题,将使您的构建失败。我建议在 Whosebug 上问第二个问题来描述你的情况并讨论是否有更好的选择。
您可以使用任务的输出变量并在下一个任务中重复使用这些变量。这一切都受支持,没有问题(请参阅 https://roadtoalm.com/2016/08/11/set-output-variable-in-a-powershell-vsts-build-task/ 示例)。