TFS 发布:一次将 setup.exe 复制到多个 Azure VM
TFS Release: Copy setup.exe to multiple Azure VMs at once
我有多个 Azure VM(经典)运行 并希望将 TFS 构建过程的结果复制 setup.exe 到这些 VM。由于设置的大小约为 800MB,我不想为每个 VM 复制 x 次。仅复制一次然后分发到所有 VM 的最佳做法是什么?
由于您使用的是 Azure VM,因此您可以设置文件存储,然后让 VM 将驱动器映射到文件存储。通过这种方式,您可以将文件上传到一个位置,但您的所有 VM 都可以访问它。
https://docs.microsoft.com/en-us/azure/storage/storage-dotnet-how-to-use-files
通常我们使用 Azure File Copy 任务,它使用 AzCopy 来处理复制情况。
When the target is Azure VMs, the files are first copied to an
automatically generated Azure blob container and then
downloaded into the VMs. The container is deleted after the files have been successfully copied to the VMs.
即使它不会多次将同一文件从构建代理复制到虚拟机。下载在 azure 罐中。 800MB 仍然是一个很大的文件大小。这需要很长时间。
文件存储是一个很好的解决方案,但是您需要首先手动将驱动器与所有 VM 的文件存储映射。文件存储不支持 AzCopy。您需要在 TFS 发布定义中使用 powershell 脚本来处理这个问题。
我有多个 Azure VM(经典)运行 并希望将 TFS 构建过程的结果复制 setup.exe 到这些 VM。由于设置的大小约为 800MB,我不想为每个 VM 复制 x 次。仅复制一次然后分发到所有 VM 的最佳做法是什么?
由于您使用的是 Azure VM,因此您可以设置文件存储,然后让 VM 将驱动器映射到文件存储。通过这种方式,您可以将文件上传到一个位置,但您的所有 VM 都可以访问它。
https://docs.microsoft.com/en-us/azure/storage/storage-dotnet-how-to-use-files
通常我们使用 Azure File Copy 任务,它使用 AzCopy 来处理复制情况。
When the target is Azure VMs, the files are first copied to an automatically generated Azure blob container and then downloaded into the VMs. The container is deleted after the files have been successfully copied to the VMs.
即使它不会多次将同一文件从构建代理复制到虚拟机。下载在 azure 罐中。 800MB 仍然是一个很大的文件大小。这需要很长时间。
文件存储是一个很好的解决方案,但是您需要首先手动将驱动器与所有 VM 的文件存储映射。文件存储不支持 AzCopy。您需要在 TFS 发布定义中使用 powershell 脚本来处理这个问题。