Press enter to see results or esc to cancel.

Integrated DevOps

Integrated DevOps with Azure, Git, PowerShell & Slack

At the Sitecore Symposium 2018 edition I hosted a session about how to optimize the DevOps process around your automated deployments using Azure DevOps, demoing how we got our development environment to the next level of maturity, increasing the developer productivity and fun of our Sitecore software deliveries.

In my talk, I referred to several blog posts and online resources about the Continuous Delivery and DevOps topic. For your convenience, I grouped all of these references in one blog post.

Helix & DevOps

The first step to automate delivery is to build your Helix structured Sitecore project. The most common way to fullfil this task is using Gulp scripts in combination with the Visual Studio Task Runner, like the Habitat project also demonstrates. I did not mention this in my talk because I assumed it as being basic knowledge, but if you want to have a complete overview of the whole DevOps pipeline it is a good idea to start here: https://helix.sitecore.net/devops/index.html.

Azure DevOps

After building your project locally, it’s time to create a build and release pipeline in Azure DevOps to be able to deploy your Sitecore application to either your test, acceptance and / or production environment.

You can find a full overview of all the pipeline features of Azure DevOps on this page: https://docs.microsoft.com/en-us/azure/devops/pipelines/?view=vsts.

Specifically for build automation and release management, the following video gives you a very nice step by step explanation of the whole process:

Infrastructure as Code

In my previous talk about Blue Green Sitecore Deployments on Azure I walked you through all the ingredients required to build your Sitecore topology from ARM templates, how to deploy a vanilla Sitecore instance on that environment and how to do Blue Green deployments in the PaaS architecture. Check this blog post including my recorded session with a lot of Sitecore specific hints & tips for your Azure DevOps build and release pipeline configuration:

Blue Green Sitecore Deployments on Azure

You can find the Open Source repository of my Azure scripts on my GitHub account: https://github.com/robhabraken/Sitecore-Azure-Scripts and, because my Sitecore 9 version is not yet published, be sure to also check out the QuickStart templates from Sitecore overe here: https://github.com/Sitecore/Sitecore-Azure-Quickstart-Templates.

Please note that I have updated my templates a few times, explaining all the improvements over time (of which most are also already implemented by Sitecore within their templates). Read up on those over here:

Azure templates update

… and here:

Sitecore Azure scripts update

Zero downtime

Then, when it comes to having your website up & running 24/7, while being able to deploy daily and during office or peak hours, make sure you can guarantee zero downtime deployments. I wrote a blog post about the hot swapping technique required for this, including some tips & tricks on how to trouble shoot your setup when you still experience a cold start of your application:

Hot Swappin’

(Custom) Slack integrations

Get to know more about the GitHub for Slack app and the Azure DevOps Slack Integration. They are really useful to streamline your team’s communication. When you want to take it a step further and define your own Slack commands, triggers and integrations, find out all about building your own custom Slack Apps at https://api.slack.com/slack-apps!

Azure Functions PS scripts for Slack integration

Our Slack integration, pulling data from GitHub and Azure DevOps, and pushing it back to Slack, will be made Open Source later on. Although it is already being used in production, our code is still highly specific to our environment and rated as experimental. After it is cleaned up and easier configurable, we will either share our code directly or make our Slack App and Azure Functions / Logic app public.

Automated Testing

Apart from the more default unit testing of C# code, we also started to unit test our React code, and switched to a new tool for our UI regression tests. For the latter, and for end user simulation, we use Cypress, check out https://www.cypress.io/ for more info and a pre-recorded demo video. Unit tests on React code are done using Jest, an easy to use JavaScript testing framework, which can be found at https://jestjs.io/.

Quality Assurance

We use a SonarQube dashboard for code analysis, both during nightly builds (automated using TeamCity in our case) and as a part of our development process. We hook SonarQube analysis into our Pull Request status checks and into our build pipeline within Azure DevOps. SonarQube is a valuable tool to increase your maintainability, security and application reliability. Visit https://www.sonarqube.org/ for more information.

Content. Content. Content.

We all know Unicorn, which we use for promoting Sitecore definition items through our build street automatically, and we love it! But for on demand content rollback of editorial content, we use Razl from TDS. It let’s you compare databases, roll back content selectively and you can even script it to be used from within your Visual Studio Task Runner.

Find out more about Razl at https://www.teamdevelopmentforsitecore.com/Razl.

NB: the full Gulp script and config examples are shown in my presentation. Check out my slide deck for more information on this topic.

Blog by Bas Lijten

Keep an eye out for new articles on http://blog.baslijten.com/. My fellow Sitecore MVP Bas Lijten has written a number of very interesting and in depth articles about Continuous Delivery related topics. If you want to learn more about (custom) Sitecore Web Deploy Packages, zero downtime deployments, how to optimally configure Azure DevOps, the Sitecore Azure toolkit and deployment optimization of complex topologies in general, be sure to check out his blog!

 

Comments

Leave a Comment