无需 TFS 或 VSTS 即可自动部署 Service Fabric 项目

Automate deployment of Service Fabric project without TFS or VSTS

我知道您可以 publish a Service Fabric application written in C# using Visual Studio, and I have read this article on using TFS or VSTS 设置 Service Fabric 应用程序的持续集成 DevOps 构建。

我怎样才能使用 PowerShell 手动完成所有这些操作? 我知道我可以使用 this article on deployment 中的 PowerShell 执行以下操作:

相反,这里有两个我似乎无法弄清楚哪些可以帮助我从 PowerShell 执行此操作的位:

如果您还没有看过这篇 link,请查看 Deploy and Remove Packages using Powershell 文章。

Suppose you have a folder named MyApplicationType that contains the necessary application manifest, service manifests, and code/config/data packages. The Copy-ServiceFabricApplicationPackage command uploads the package to the cluster Image Store

获取目录并上传。然后你必须告诉它拍摄该图像并在应用程序中使用它。

The Register-ServiceFabricApplicationType command returns only after the system has successfully copied the application package. How long this takes depends on the contents of the application package. If needed, the -TimeoutSec parameter can be used to supply a longer timeout.

注册后您可以创建应用程序:

You can instantiate an application by using any application type version that has been registered successfully through the New-ServiceFabricApplication command

要通过命令行生成包,您可以在 sfproj 文件上调用 "Package" 目标。

create a deployment package for Service Fabric that includes all artifacts necessary to run the designed workflows at runtime

上查看我的回答

然后按照 blackSphere 建议的 https://azure.microsoft.com/en-us/documentation/articles/service-fabric-deploy-remove-applications/ 中的说明进行操作。