Deploy from Linux / Docker to Windows / IIS

Until now we’ve just been doing build/test (e.g. CI) but want to dip our toes in with deployment (CD).

We are mostly building .NET dotnet core web applications which we deploy via IIS.

Initially I just want to be able to deploy updates (i.e. IIS is already configured, folder structure already in place etc).

I’m intending to go down the route of;

  • dotnet publish from the linux/docker runner to a local path
  • ssh to windows server (will need to enable openssh server)
  • zip up the current contents of the www folder
  • delete the contents of the www folder (this can be problematic if it’s “in use”, so may need to use a command to stop the site in IIS first)
  • scp the new files across

Does that sounds like a good plan? Writing it down, i’m now thinking creating a new folder with and SCPing the files across maybe should be the first step then if we can change IIS to point to the new folder the downtime might be minimized…

It would be great in future to run a suite of (non-destructive) tests against the production environment after deployment and even be able to rollback if any fail.

Have you come up with anything?

Thanks

Overall, this seems like a good path to take so far.
Definitely having a way to easily revert changes is also helpful. If everything is managed in Gitlab, a revert commit of the bad MR and rerunning the CD pipeline would be able to fix your issues I imagine.

Do you have a staging environment where you could actually test out more of the automated CD so you aren’t accidentally bringing down your production environment with these new changes?