使用 Octopus Deploy in a Package 部署 ARM 模板

Deploy ARM Template with Octopus Deploy in a Package

我在 Visual Studio 中创建了一个 ARM 模板,我需要打包 JSON 文件,以便我可以使用 Octopus Deploy 中的选项来部署 JSON 文件在 ARM 模板中作为包 - 如以下 link 部分所述,在 '包中包含的模板

部分

https://octopus.com/docs/deploying-applications/azure-deployments/resource-groups

问题是我不知道Visual Studio中有什么应用程序来打包应用程序?我做了一些研究,我读到了在 nuspec 中使用的最佳软件包,如下所述:

https://dinventive.com/blog/2016/10/20/5-steps-and-under-30-minutes-to-deploy-arm-templates-via-octopus-deploy/

但是,有一大堆 nuspec 应用程序。如图所示,我得到我需要的壁橱是 NuGetToolsPackager。

nuget

但是,如果有任何其他建议,我们将非常欢迎。

您提供的 link 展示了如何从构建服务器(在本例中为 VSTS)创建包,这是推荐的方法。打包 + 构建应该从构建服务器进行编排,而不是从 IDE 如果可能的话 :)

也就是说,从 Visual Studio 执行此操作的一种好方法是向 the OctopusTools package 添加依赖项,它将在构建期间下载 Octo.exe。然后你可以添加一个 post-build 脚本来调用 Octo.exe pack 来创建你的包,然后 Octo.exe push 将它推送到存储库。

Octo.exe pack 的文档:https://octopus.com/docs/packaging-applications/creating-packages/nuget-packages/using-octo.exe

Octo.exe push 的文档:https://octopus.com/docs/api-and-integration/octo.exe-command-line/pushing-packages