TIHIDI: Deploy a Sitecore application via Octopus Deploy

I have only been working with Octopus Deploy for a year but its one of my favorite tools. We depend on it for our end to end 100% automated deployments to all of our environments. The trick is to set it up properly in the first place. I was able to get some guidance from Kamruz Jaman when I got started and that helped me immensely to understand Octopus Deploy.

The deployment I am going to describe is how I set it up, it might not be right for all situations but hoping that it will provide some insight into how you would want to set it up for your own environment.

First, we use Slow Cheetah to do config transforms for local deploys on dev machines. This is important, because our main configs (not the transforms) will host Octopus variables, which is a huge part of this process.

TIHIDI: Stands for This Is How I Do It. I am going to write a series of blog posts going through how I do Sitecore related work. Hope it helps you!

Octopus Deploy is free for small teams and its an efficient and powerful deployment tool. Octopus has several process step templates ranging from a PowerShell step to a SQL backup step. For more information visit: https://octopus.com/

Setup

Here are the steps for the deployment server:

  1. Create a local system admin account – call it OctoAdmin for example. This account will be used by the Octopus windows services to carry out your tasks.
  2. Install Octopus Deploy on the deployment server.
  3. Change the Logon user for the OctopusDeploy windows service to the local system admin account, which is OctoAdmin in our example.
  4. Add any additional URL bindings you need to access Octopus Deploy in your environment.

 

Configuration

Configuration is where the Magic is for Octopus Deploy.

Environments

In the Environments section, setup your overall environment structure: Dev, QA, Stage, Prod, etc.

Lifecycles

Lifecycles are how you control the flow of releases between environments. If you wish to auto deploy to the first environment, like dev for instance and then promote it to the upper environments.

Variable Sets

This is where the gravy is. Set this up properly and you can do a ton of things. The idea is that the variable hold substitution values which you can replace at a machine level, environment level, role level, etc. You define your variables for debug mode, connection strings, etc. Anything which needs changing.

Once you defined your variables you simple substitute it in your configs using this syntax:  <add name=”core” connectionString=”#{connectionstrings.core}” />

Octopus has a ton of documentation here: https://octopus.com/docs

Project

The project setup relies on all the setup we have done so far. Octopus gives you a ton of step templates which will let you deploy packages, run PowerShell, backup SQL Server db’s, etc. There are a ton of community templates which you can use as well. Below is a sample from one of our projects:

This combined with TIHIDI: Continuous Integration for a Sitecore solution – Engage! will get you going.

 

The key is to start small but have the right structure and you can build upon that.

If you have any questions or concerns, please get in touch with me. (@akshaysura13 on twitter or on Slack).

Leave a Reply

Your email address will not be published. Required fields are marked *