Running Sitecore Powershell scripts from Octopus Deploy

Deployment Automation with Sitecore Powershell Extensions (SPE) and Octopus Deploy

If your having trouble picking a strategy for deployment automation for your Sitecore application I highly recommend taking a serious look at Octopus Deploy (https://octopus.com/).. I've been using Octopus Deploy for about 2 years and the product keeps getting better almost on a weekly basis. The best part about it is that Octopus is so easy, just about anyone can use it.  I cannot even imagine what I would do without it.  We deploy are doing over 100 deployments daily and we managing 40 different environments.  I'm not sure how we would do it with any of the other tools we evaluated before we settled on Octopus.

When we first set up out Sitecore deployments with Octopus every time we needed to automate something in Sitecore we would go through the following process.
  1. Create a new assembly that does what it needs to do in Sitecore.
  2. Create a new endpoint that exposes the functionality (needs to be secured as well, usually needs to trigger a agent/background job so endpoint doesn't time out)
  3. Create a script or application to 
    1. call the endpoint.
    2. monitor the job and report progress
    3. detect problems
  4. Integrate that into Octopus Deploy
Although this was a tremendous improvement from doing this stuff manually, it got old very quick.  

Sitecore Powershell Extensions (SPE) to the Rescue!!

The first time I saw SPE I knew I needed it.  It didn't take long until every single time I fired up SIM (Sitecore Instance Manager) to do local development, I found myself installing SPE. Based on my experience with it I new we needed to get this into our standard Sitecore deployment.  Nobody should ever have an instance of Sitecore running without SPE.  It solves every problem you never even knew you had: Reporting, Deployment Automation, Test Automation, and so much more. 

Now that we have SPE in all our environments, we have deleted more custom code  re related. to deployments than we have created. Everything we have needed to do we were able to do easier, faster, and with more visibility by simply integrating Octopus Deploy directly with the SPE remoting feature.  

The cleanest way I found to set up Octopus and SPE is to: 
  1. Install a Octopus Deploy Tentacle directly on the CMS server, (read me)
  2. Enabling SPE remoting (read me)
  3. Add your Sitecore Automation user to the "sitecore\PowerShell Extensions Remoting" Role
  4. Use the template at https://gist.github.com/BissTalk/442bf3cc8c8c39e64898bbeda29a9943

The step Template will look like this:

And the results look like:

No comments

No comments :

Post a Comment