简体   繁体   中英

Automate deployment of Service Fabric project without TFS or VSTS

I know you can publish a Service Fabric application written in C# using Visual Studio, and I have read this article on using TFS or VSTS to set up continuous integration DevOps builds of a Service Fabric application.

How can I just do this all manually using PowerShell? I know I can do the following using PowerShell from this article on deployment :

  • Use Visual Studio to package the project.
  • Transfer the package to a remote server.
  • Use the PowerShell script examples in the article to deploy the package while I am in the context of the remote server.

Instead, here are two bits I can't seem to figure out which would assist me in doing this from PowerShell:

  • Using PowerShell, how can I package my Service Fabric project the same way you can when you are in the context of Visual Studio?
  • Using PowerShell, how can I remotely deploy my Service Fabric project the same way you can when you are in the context of Visual Studio?

If you haven't seen this link, take a look at Deploy and Remove Packages using Powershell article.

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

That takes a directory and uploads it. Then you have to tell it to take that image and use it in the application.

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.

After you register it you can create the application:

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

To generate the package through the command line, you can call the "Package" target on the sfproj file.

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

Then follow the instructions from https://azure.microsoft.com/en-us/documentation/articles/service-fabric-deploy-remove-applications/ as blackSphere suggested.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM