This post is a step-by-step guide for creating a TeamCity project which will be used for the workshop Sitecore 9 – Automated deployment with TeamCity and automated code review with SonarQube (generally, it’s just my own way to translate this set up guide to TeamCity so she can give me a hand to set it up)
- download TeamCity
- installing and configuring the TeamCity Server
- create a new TeamCity project VietHoangSitecore
- Administration -> Projects -> Create project (project type: Manually)
- create a new TeamCity build configuration Release
- Administration -> Projects -> VietHoangSitecore -> Create build configuration
- create a new Version Control Settings Gitlab_Https
- Administration -> Projects -> Viet Hoang – Simple Development Framework -> Release
- left navigation: select Version Control Settings -> Attach VCS root
- fulfill the fields below:
- Type of VCS: Git
- VCS root name: Gitlab_Https
- Fetch URL: https://gitlab.com/viet.hoang/my-simple-framework.git
- Default branch: refs/heads/%vhs.gitBranch%
- Authentication method: Anonymous
- click Test connection to ensure Connection successful!
- click Save
- create Build Steps
- Administration -> Projects -> VietHoang
Sitecore -> Release - left navigation: select Build Steps -> Add build step
- Administration -> Projects -> VietHoang
- add build step Create “cake-config.json” file
- fulfill the fields below:
- Runner type: PowerShell
- Step name: Create “cake-config.json” file
- Script: Source code
- Script source: copy/paste this one
- Script execution mode: Execute .ps1 from external file
- click Save
- fulfill the fields below:
- repeat #6 to add build step Create “publishsettings.targets” file
- fulfill the fields below:
- Runner type: PowerShell
- Step name: Create “publishsettings.targets” file
- Script: Source code
- Script source: copy/paste this one
- Script execution mode: Execute .ps1 from external file
- click Save
- fulfill the fields below:
- repeat #6 to add build step Create “Common.LocalSettings.config” file
- fulfill the fields below:
- Runner type: PowerShell
- Step name: Create “Common.LocalSettings.config” file
- Script: Source code
- Script source: copy/paste this one
- Script execution mode: Execute .ps1 from external file
- click Save
- fulfill the fields below:
- repeat #6 to add build step Create “GlobalAssemblyInfo.cs” file
- fulfill the fields below:
- Runner type: PowerShell
- Step name: Create “GlobalAssemblyInfo.cs” file
- Script: Source code
- Script source: copy/paste this one
- Script execution mode: Execute .ps1 from external file
- click Save
- fulfill the fields below:
- repeat #6 to add build step Deploy All Unicorn Folders To Sitecore Instance
- fulfill the fields below:
- Runner type: PowerShell
- Step name: Deploy All Unicorn Folders To Sitecore Instance
- Script: Source code
- Script source: copy/paste this one
- Script execution mode: Execute .ps1 from external file
- click Save
- fulfill the fields below:
- repeat #6 to add build step Execute .\build
- fulfill the fields below:
- Runner type: PowerShell
- Step name: Execute .\build
- Script: File
- Script file: build.ps1
- Script execution mode: Execute .ps1 from external file
- Script arguments: -Target Deploy
- click Save
- fulfill the fields below:
- repeat #6 to add build step Execute the Sonar Scanner for MSBuild
- fulfill the fields below:
- Runner type: PowerShell
- Step name: Execute the Sonar Scanner for MSBuild
- Script: Source code
- Script source: copy/paste this one
- Script execution mode: Execute .ps1 from external file
- click Save
- fulfill the fields below:
- finally we’ve just done for all the build steps
- we will fulfill the value of all the configuration parameters so that the automated deployment and automated code review will be able to run successfully
-
- Administration -> Projects -> VietHoang
Sitecore -> Release - left navigation: select Parameters
- Administration -> Projects -> VietHoang
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 Playing!
One thought on “Sitecore 9 Workshop – How to create a TeamCity project for automated deployment and automated code review”