使用 Release Management 时防止不必要的工件下载
Prevent unnecessary artifact download when using Release Management
我正在使用 TFS 2015 Update 2 Release Management(即 "Release" 选项卡),并且我的构建将所需的输出放在文件共享放置位置。它看起来像:
/Drop
--> /App 1
--> /App 2
--> /App 3
我的发布定义有一个 Powershell 任务来部署每个应用程序。这很好用,并且因为上面的每个应用程序(应用程序 1、应用程序 2、应用程序 3)都被定义为它们自己的工件,所以当我在找到要执行的 powershell 脚本时调出“链接的工件”对话框时,我得到了很好的路径选择。
问题是当 VSOAgent 在给定的部署服务器上进行部署时,它会下载整个发布定义的所有链接工件——无论它们是否被使用。因此,如果我有一个引用 App 1 的 Powershell 任务,我也会下载 App 2 和 App 3。
就我而言,我的构建产生了数十个工件,其中可能只有 20% 被部署到任何给定环境。所以我下载了一大堆我不需要的东西。事实上,这意味着一些东西应该花费(并且 DID 在旧的发布管理中花费)也许 5 分钟现在需要 20 分钟才能下载工件。
有什么办法可以避免这种情况吗?
Release Management 下载您默认选择的构建定义发布的所有工件。目前没有任何设置可以配置它。您可以在 VSTS User Voice.
上提交功能请求
我不知道它是否在 TFS 2015 更新 2 版本管理中可用,因为我们已经转移到更新 3,但是对于更新 3,您可以在环境级别设置它。
- 在环境定义上单击省略号 (...)
- 选择菜单选项"Configure variables..."
- 在对话框中 window select "General" 选项卡
- 切换复选框"Skip artifacts download"
我无法访问 TFS 2015 Update 2,因此您必须试一试。
执行此操作后,您可以添加任务以手动文件复制所需的工件。
刚刚发布。 VSTS 和 TFS 2018 有一项新功能可能符合您的需求
Previously, as part of a deployment phase, you could choose to either download all the artifacts or skip them all. Now you can choose the artifacts that need to be downloaded. This can save time by ensuring the agent only has to download what it needs. See the release artifacts documentation for more information. This feature was prioritized based on a suggestion.
https://visualstudio.uservoice.com/forums/330519-visual-studio-team-services/suggestions/13396200-only-download-artifacts-required-for-task-executio?tracking_code=200f3ad38ab610cdbbdbb2afa5a9b7a5#{toggle_previous_statuses}
- 编辑适当的发布管道
- 查看适合环境的阶段任务
- Select 主要代理工作,一系列配置应该可用
- 滚动到工件下载部分
- Select 是否下载工件
我正在使用 TFS 2015 Update 2 Release Management(即 "Release" 选项卡),并且我的构建将所需的输出放在文件共享放置位置。它看起来像:
/Drop
--> /App 1
--> /App 2
--> /App 3
我的发布定义有一个 Powershell 任务来部署每个应用程序。这很好用,并且因为上面的每个应用程序(应用程序 1、应用程序 2、应用程序 3)都被定义为它们自己的工件,所以当我在找到要执行的 powershell 脚本时调出“链接的工件”对话框时,我得到了很好的路径选择。
问题是当 VSOAgent 在给定的部署服务器上进行部署时,它会下载整个发布定义的所有链接工件——无论它们是否被使用。因此,如果我有一个引用 App 1 的 Powershell 任务,我也会下载 App 2 和 App 3。
就我而言,我的构建产生了数十个工件,其中可能只有 20% 被部署到任何给定环境。所以我下载了一大堆我不需要的东西。事实上,这意味着一些东西应该花费(并且 DID 在旧的发布管理中花费)也许 5 分钟现在需要 20 分钟才能下载工件。
有什么办法可以避免这种情况吗?
Release Management 下载您默认选择的构建定义发布的所有工件。目前没有任何设置可以配置它。您可以在 VSTS User Voice.
上提交功能请求我不知道它是否在 TFS 2015 更新 2 版本管理中可用,因为我们已经转移到更新 3,但是对于更新 3,您可以在环境级别设置它。
- 在环境定义上单击省略号 (...)
- 选择菜单选项"Configure variables..."
- 在对话框中 window select "General" 选项卡
- 切换复选框"Skip artifacts download"
我无法访问 TFS 2015 Update 2,因此您必须试一试。 执行此操作后,您可以添加任务以手动文件复制所需的工件。
刚刚发布。 VSTS 和 TFS 2018 有一项新功能可能符合您的需求
Previously, as part of a deployment phase, you could choose to either download all the artifacts or skip them all. Now you can choose the artifacts that need to be downloaded. This can save time by ensuring the agent only has to download what it needs. See the release artifacts documentation for more information. This feature was prioritized based on a suggestion.
https://visualstudio.uservoice.com/forums/330519-visual-studio-team-services/suggestions/13396200-only-download-artifacts-required-for-task-executio?tracking_code=200f3ad38ab610cdbbdbb2afa5a9b7a5#{toggle_previous_statuses}
- 编辑适当的发布管道
- 查看适合环境的阶段任务
- Select 主要代理工作,一系列配置应该可用
- 滚动到工件下载部分
- Select 是否下载工件