Automated Deploy with Octopus - Commerce Engine

6/18/2020 Octopus Automated Deploy Sitecore Sitecore Commerce Commerce Engine

Here, I go over the automated deploy process for the Sitecore Commerce Engine using Octopus Deploy

OMG look how many ppl have commented

If you have not already, please read the Intro of this Article series. Otherwise, this may seem rather vague and little confusing. The Commerce Engine Project for Octopus deploy is rather straight forward. It is a lightweight .Net Core application served as an API for commerce related functionality. There are not too may steps in the process but the release takes care of the Authoring, Minions, Shops, and Ops engine sites all in one go.

Package Information

For this project, I use the EnginePack package. There are no base packages needed to apply for this particular project as the solution for the commerce engine is packaged up every time.

Configuration Files

For the configuration transforms, I used Slow Cheetah using the JDT tool kit to find and replace the json configuration changes. For more information, click this link. Below are a list of the files for the configuration changes. I will only provide the transformed files so you can plug them into your project

Project Variables (aside from the global variables)

  1. databasePassword
  2. databasePrefix 
  3. databaseUsername
  4. encryptionCertificateHash
  5. encryptionKey
  6. encryptionKeyStorageLocation: c:\\Encryption-Keys\\
  7. encryptionSID
  8. globalDatabaseName: #{databasePrefix}_Global
  9. imageCdnRoot
  10. logLevel
  11. shopName: CommerceEngineDefaultStorefront
  12. xpPassword
  13. xpUsername


Release Process

  1. Install Certificates (click title for more info) 
    1. Install Root Certificate to Trusted Root Certification Authorities
    2. Install Storefront Certificate to Personal store
    3. Install Engine Certificate to Personal store
    4. Install Localhost Engine Certificate to Personal
    5. Install Identity Certificate to Personal
  2. Add Encryption Key
    1. This deploys the package Encryption Key (which is just an xml file) to #{encryptionKeyStorageLocation}. It uses the Deploy a Package step template from the Octopus public library. I set the Substitute Variables in Files to **\*.xml
  3. Add Host Entries (click title for more info) 
    1. Add Commerce Host Entry (for specific sites)
    2. Add XP Host Entry
    3. Add Identity Host Entry
  4. Deploy Site (click title for more info)
    1. Package ID: EnginePack
    2. Install to: #{deployPath}
    3. Web site Name: #{siteName}
    4. Application Pool:
      1. Application Pool name: #{siteName}
      2. Identity: Custom user...
      3. Username: #{applicationPoolUser}
      4. Password: #{applicationPoolPassword}
    5. Bindings
      1. I added three bindings for the Engine sites:
        1. http for #{hostName}
        2. https on port 443 for #{hostName}
        3. https on port #{localhostPort} for localhost
    6. Custom Deploy Scripts
      1. I added a custom powershell script to kill any existing commerce engine deploy tasks (you cannot purge the directory if this is running)
    7. Substitute Variables in Files: **\*.json