Sitecore 8.2 Update 7 has just been out with Data Protection Considerations. Personally, I wanted to release a new version of my simple framework along with some updates:
- Upgrading Sitecore References via Nuget from Sitecore 8.2.6 to Sitecore 8.2.7 ones
- Refining the Sitecore template structure (there are some places violate Helix principles)
- Updating gulp files to support auto-deploy with TeamCity
As a consequence, version 1.9 is out.
Auto-deploy with TeamCity
- Applying build and integration of Sitecore Helix
- Using XML Transforms to support multiple build configurations
- Using Unicorn – a Sitecore utility designed to simplify deployment of Sitecore items across environments automatically
Setup Prerequisites
- Sitecore 8.2 Update 7
- TeamCity
- Gulp build runner to run gulp scripts
- TeamCity_VhLocal.zip: my TeamCity project is used for the tutorial
- Node.js
How to set it up
- use SIM to setup 03 new Sitecore 8.2 Update 7 instances:
- 01 sitecore instance whose host name should be viethoang.cm.local
- 01 sitecore instance whose host name should be viethoang.cd1.local
- bind another host name hoavi.local
- 01 sitecore instance whose host name should be viethoang.cd2.local
- bind another host name demo.local
- copy-paste \App_Config\ConnectionStrings.config of cm to overwrite the one of cd1 & cd2 to ensure 03 Sitecore instances using the same databases
- install Node.js
- install TeamCity
- install Nuget.exe tool (latest version) in TeamCity
- Administration -> Tools -> Install Tool…
- install Gulp build runner to run gulp scripts in TeamCity
- Administration -> Plugins List -> Upload plugin zip
- restart TeamCity Server after installing
- import TeamCity_VhLocal.zip to TeamCity
- Administration -> Projects Import -> Upload Archive then click Configure Import Scope button
- check Viet Hoang – Simple Development Framework checkbox and then click Start Import button
- go to Administration -> <Root Project> -> Viet Hoang – Simple Development Framework -> CM – CD1 – CD2 -> Parameters in order to correct 07 Configuration Parameters because they might be different between my machine and your machine
- vhs.deployIisAppPath_CD1: the CD1 website name in IIS
- vhs.deployIisAppPath_CD2: the CD2 website name in IIS
- vhs.deployIisAppPath_CM: the CM website name in IIS
- vhs.instance.Root_CD1: the full path parent folder of CD1 website folder
- vhs.instance.Root_CD2: the full path parent folder of CD2 website folder
- vhs.instance.Root_CM: the full path parent folder of CM website folder
- vhs.unicorn.sourceFolder: the full path of an available folder which will stores *.yml files (Note: it should be short such as “C:\unicorn_files” in order to avoid “Windows File Paths Longer Than 255 Characters” issue in the very first run of Unicorn Sync)
- vhs.deployIisAppPath_CD1: the CD1 website name in IIS
What’s next?
Run build Viet Hoang – Simple Development Framework :: CA – CD1 – CD2. Hopefully, you will have no any issues and when the build is done, you would see something like this:
How to verify the automating Sitecore deployments on your machine
- open a browser, navigate to http://viethoang.cm.local/sitecore/
- log into it by using (admin / b)
- do publish site
- open a browser, navigate to http://hoavi.local
- open a browser, navigate to http://demo.local
Hopefully, you would see something like this:
Note: you can play with Web Deploy (should ensure to enable its all features)
as well by updating parameter vhs.forceToPublishWithMsBuild to false
- go to Administration -> <Root Project> -> Viet Hoang – Simple Development Framework -> CM – CD1 – CD2 -> Parameters
Additional one
Happy Sitecore Coding!
2 thoughts on “My simple Sitecore development framework version 1.9 and auto-deploy with TeamCity”