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
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.
The idea is that you can have a separate configuration file per project.
The Application Control Scripts
There are two install scripts
- https://github.com/Sitecore/Sitecore.Demo.Retail/blob/master/install-commerce-server.ps1
- https://github.com/Sitecore/Sitecore.Demo.Retail/blob/master/install-commerce-sites.ps1
- I also have a third for the creation of SOLR indexes. Its not part of the public repo but if you reach out via slack I’ll share it.
The Commerce Server Install scripts executes 5 steps:
- Create Required Users
- Create Database Logins
- Enable Windows Authentication
- Run Commerce Server Installer
- Run Commerce Server Configuration
The commerce site installer executes 16 steps:
- Enable commerce config
- Create IIS App Pools
- Create IIS Websites
- Configure host file
- Create Commerce Server Site
- Import Database Changes
- Import Commerce Server Resources
- Disable-LoopbackCheck (for development machines)
- Test Commerce Server WebServices
- Restore Solution Packages
- Deploy Commerce Engine
- Test Commerce Engine
- Create self signed certificate
- Check certificates
- Fix Authorization Store
- Restarting IIS
- 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: