0
votes

I'm looking for ways to improve a .NET Core console application deployment. Currently I just copy the published version to the server and run "dotnet xxx.dll" (yep...) I've set up appveyor and it pushes a nuget package with my console app to a nuget repository. This nuget repository is imported to Octopus Deploy, so I can deploy it production. The part that confuses me is how I can actually kill a process of a previous version and start a new one. Does Octopus Deploy support it without getting too deep with Power Shell?

P. S. I could turn my console app into a Windows Service but I don't want to as I like to keep an option of deploying to both Windows and Linux

2

2 Answers

2
votes

If you have a deploy.ps1 script in the root of your nuget package you can include commands to kill the existing version (stop-process ) and start the new one.

2
votes

Regarding running it as a Windows Service, you might want to look at NSSM. We run (and deploy through Octopus) a console app as a Windows Service using NSSM. It does require a deployment step with PowerShell. There's a community step template for Octopus that will deploy a NSSM service, but it didn't quite do what we wanted. Still it's a good place to start for the basic PowerShell required.