guide

Sitecore 9 Workshop – How to create a TeamCity project for automated deployment and automated code review

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)

  1. download TeamCity
  2. installing and configuring the TeamCity Server
  3. create a new TeamCity project VietHoangSitecore
    • Administration -> Projects -> Create project (project type: Manually)
  4. create a new TeamCity build configuration Release
    • Administration -> Projects -> VietHoangSitecore -> Create build configuration
  5. 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
    • ws_1
  6. create Build Steps
    • Administration -> Projects -> VietHoang
      Sitecore -> Release
    • left navigation: select Build Steps -> Add build step
  7.  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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. finally we’ve just done for all the build steps
    • ws_2
  15. 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
    • ws_3

 

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

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.