build · deployment

An approach for automating Sitecore deployments with TeamCity at your machine

This post is a summary of my workshop at the company. However, it might be an initiative of your own approach for automating Sitecore deployments with TeamCity.

Setup Prerequisites

How to set it up

  • Use SIM to setup 03 new Sitecore 8.2 Update 2 instances:
    • 01 CA whose site name should be viethoang.ca.local
    • 01 CD whose site name should be viethoang.cd1.local
    • 01 CD whose site name should be viethoang.cd2.local
  • copy-paste \App_Config\ConnectionStrings.config of CA to overwrite the one of CD1 & CD2 to make sure 03 Sitecore instances using the same databases
  • Install Node.js
  • Install TeamCity version 10.0.4
  • install Nuget.exe 3.5.0 tool in TeamCity
    • Administration -> Tools -> Install Tool…
    • asd_10
    • asd_11.png
  • install Gulp build runner to run gulp scripts in TeamCity
    • Upload it to TeamCity
    • Administration -> Plugins List -> Upload plugin zip
    • asd_1
    • restart TeamCity Server via Window Services
    • asd_2.png
  • Import TeamCity_VhLocal.zip to TeamCity
    • Administration -> Projects Import -> Upload Archive then click  Configure Import Scope button
    • asd_3
    • check Vh local checkbox then click Start Import button
    • asd_4.png
  • go to Administration -> -> Vh Local -> CA – CD1 – CD2 -> Parameters in order to correct 04 Configuration Parameters because they might be different between my machine and your machine
    • asd_5
      1. vh.instanceRoot_CA: the full path parent folder of CA website folder
        • asd_6.png
        • Note: backslashes are escaped
        • Ex: “F:\\Sitecore Training\\viethoang.ca.local”
      2. vh.instanceRoot_CD1: the full path parent folder of CD1 website folder
        • Note: backslashes are escaped
        • Ex: “F:\\Sitecore Training\\viethoang.cd1.local”
      3. vh.instanceRoot_CD2: the full path parent folder of CD2 website folder
        • Note: backslashes are escaped
        • Ex: “F:\\Sitecore Training\\viethoang.cd2.local”
      4. vh.unicornFolder: the full path of an available folder which will stores *.yml files (Note: it should be short such as “D:\unicorn_files” in order to avoid “Windows File Paths Longer Than 255 Characters” issue in the very first run of Unicorn Sync)

What’s next?

Run build Vh Local :: CA – CD1 – CD2. Hopefully, you will have no any issues and when the build is done, you would see something like this:

asd_9.png

How to verify the automating Sitecore deployments at your machine

Open a browser, navigate to:

Hopefully, you would see something like this:

homepage

Got issues?

Please send your issues (with screenshots if possible) to viet.hoang.sitecore@gmail.com so that I have a chance to understand your problem and be able to suggest the solution.

Happy Sitecore coding!

REFERENCES

Advertisements

2 thoughts on “An approach for automating Sitecore deployments with TeamCity at your machine

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s