Streamlining your teams Sitecore Commerce 8.2.1 Install

A common topic among development teams is “how do I speed up the on boarding process so a new member can be productive fast”. In this post I’ll point you to some resources that will enable you to do exactly that for Sitecore Commerce 8.2.1.

The scripts I’m sharing are as a result of working with Thomas Eldblom to incorporate Sitecore Commerce into the Sitecore Helix principles and the example Habitat implementation available on GitHub.

Before I get into the detail I would like to thank Willem Haring, Hao Liu, Jean-Francois Larente and Rameez Akram. Willem produced the first version of these scripts so hats off to him.

The Aim

The aim of these scripts, at a minim, is to automate the install process on a local development machine. Each teams environment is different, different OS, different folder structure, different software installed, etc. So the idea is that you tweak them slightly to enable all developers within your organisation to get up an running, on a new machine, within a short period of time. 

The Scripts

I haven’t tried to make the scripts generic and easily able to be reused for other software installations. They are currently very specific for a Sitecore Commerce installation on a local machine. They can be leveraged to enable a continuous integration or continuous delivery scenario.

With minimal effort, one of the demo team, was able to extended the scripts to enable a QA process that spins up a complete site per pull request through team city.

Here are a few call outs:

  • I’m passing objects between scripts to minimise code and decrease development time.
  • The scripts hang together more like an application would as opposed dev ops scripts.
  • The install script are re-runnable i.e. if you need to respond to an error, you can rerun the script once you’ve fixed your issue.

The Architecture

image

The Configuration File

https://github.com/Sitecore/Sitecore.Demo.Retail/blob/master/install-commerce-config.json

In most cases the data in the config file represents the items that need to be configured on the server so you can take one look at the config and have a clear view as to what will be installed.

Most configuration elements exist as list items. For example a list of accounts or IIS app pool or IIS websites. Idea being so you have flexibility to add project specific configuration easily.

image

The idea is that you can have a separate configuration file per project.

The Application Control Scripts

There are two install scripts

The Commerce Server Install scripts executes 5 steps:

  1. Create Required Users
  2. Create Database Logins
  3. Enable Windows Authentication
  4. Run Commerce Server Installer
  5. Run Commerce Server Configuration

The commerce site installer executes 16 steps:

  1. Enable commerce config
  2. Create IIS App Pools
  3. Create IIS Websites
  4. Configure host file
  5. Create Commerce Server Site
  6. Import Database Changes
  7. Import Commerce Server Resources
  8. Disable-LoopbackCheck (for development machines)
  9. Test Commerce Server WebServices
  10. Restore Solution Packages
  11. Deploy Commerce Engine
  12. Test Commerce Engine
  13. Create self signed certificate
  14. Check certificates
  15. Fix Authorization Store
  16. Restarting IIS
  17. Bootstrap Commerce Engine and Initialise Environments

The Application Worker Scripts

https://github.com/Sitecore/Sitecore.Demo.Retail/tree/master/scripts/Commerce

The application worker scripts are a set of scripts that manage operating with one of the various systems required. They form part of the install application because they know about the definition specified in the configuration. So they are not generic for the Retail Demo’s install process but not generic to be used easily elsewhere.

There are currently 7 worker scripts:

Advertisements