Continuous Deployment with Octopus and Powershell

Oliver Picton
By Oliver PictonHead of Technical
5 minutes to read

We have recently started using the fantastic Octopus Deploy by Paul Stovell which is a truly excellent tool.

In the bad old days (hopefully) a deployment process in .NET land consisted of pressing F5, crossing your fingers, copying the files then saying to your colleagues “well that’s weird it worked on my machine” when something went horribly wrong. Thankfully these days a lot of teams are using continuous integration and can deploy a build in at least a couple of steps. But it is still often the case that a lot of the actual deployment and certainly the project setup is manual.

At Enjoy we wanted more. Our goal was to start and end a website project with a click of a button.

Our Approach

  1. Use a shared Visual Studio project template at the start of new projects which installs all our dependencies using NuGet and creates the database.
  2. Setup continuous integration on TeamCity (or the build server of your choice) which creates Octopus compatible NuGet packages.
  3. Use Octopus to manage deployments to staging and promotion to live.
  4. Write PowerShell scripts for anything not handled natively by Octopus.

PowerShell

The ability to extend Octopus using Powershell is particularly compelling. You can even use project specific variables defined in Octopus in your scripts which is really useful. At Enjoy we use it, in no short order, to configure IIS, set permissions, write out the correct robots.txt files and even to run some basic smoke tests using PhantomJS. In fact pretty much anything you currently do manually during a deployment can be automated.

So what are you waiting for? Download a copy of Octopus read the documentation and start automating your deployments today. I promise you will never look back!

Continuous Deployment with Octopus and Powershell

comments powered by Disqus

More about Oliver Picton

With over ten years' experience in web development, Ollie has had the opportunity to work in a diverse range of industries for major brands including Volkswagen, Thomas Cook and The Press Association.