There have been many posts on this topic around the Sitecore community and I’ve used bits from a few different posts that I’ve added under the references heading below.

This post details the process I’ve used recently  for deployments with Sitecore, Team Deployment for Sitecore (TDS), Git, TeamCity, Octopus Deploy and Sitecore Ship.

What is Continuous Delivery?

Continuous Delivery is a software development discipline where you build software in such a way that the software can be released to production at any time.

Martin Fowler

Software Used

I’ll assume you have TeamCity and the TeamCity Plugin for Octopus deploy but the guides are Install Team City and Install the Octopus Plugin for TeamCity.

Configure TeamCity

  1. Setup the Version Control Software here I have used Git adding the project Url, branch and credentials.TC VCS

    Key Settings

    • Fetch Url – Url to the source control repository
    • Authentication method – If you choose Password you will need an account with access to the source control repository.

     

  2. The TeamCity Build Steps look like this:-
    1. Restore NuGet PackagesRestoreNugetPacakages

      Key Settings

      • Runner Type – Choose Nuget Installer
      • Path to Solution File – Click the Tree List Icon to browse to the sln file.
      • Update Mode – Choose Update via packages.config file

       

    2. Build the Solution and Run OctoPackBuild Solution and Run OctoPack

      Key Settings

      • Runner Type -MSBuild
      • Build File Path- Click the Tree List Icon to browse to the sln file.
      • MSBuild Version – Same as your solution.
      • Command line parameters – Passing Configuration = Release as a parameter to MSBuild with /P:Configuration=Release
      • Run OctoPack – Enable to create a package to use in Ocotpus
      • OctoPack package version – Use the build number from the team City build with the %build.number% parameter

       

    3. Run Unit TestsRun Unit Tests

      Key Settings

      • Runner Type -NUnit
      • Run Tests from- Path to your test project dll relative to your project root.

       

    4. Package up the TDS .update file using NuGetNuget Pack TDS Content Update Package

      Key Settings

      • Runner Type -NuGet Pack
      • Specification Files- Use the Tree List Icon to browse to the nuspec file for the update package to create a NuGet package.
      • Version – Use the build number from the team City build with the %build.number% parameter

       

    5. Create a release in Octopus DeployOctopus Create Release

      Key Settings

      • Runner Type -Octopus Deploy: Create Release
      • Octopus Url – Url for the Octopus Server
      • API Key – Generate yours from the Octopus server follow these instructions
      • Deploy to – Required Environment from Octopus.

       

    6. Deploy the newly created release in Octopus.Octopus Deploy Release

      Key Settings

      • Runner Type -Octopus Deploy: Deploy Release
      • Octopus Url – Url for the Octopus Server
      • API Key – Use previously generated key.
      • Release number – Use Team City Parameter – %latest%
      • Deploy to – Required Environment from Octopus.

 

Part 2 will Cover the Octopus Deploy process, variables and the PowerShell scripts to install the update packages created here.

References

7 thoughts on “Continuous Delivery with Sitecore, TDS, Git, Team City, Octopus and Sitecore Ship Part 1

  1. Thank you so much for this post!
    I actually found out most of this the hard way in the last couple of weeks, but still very nice to see it all in one place like this. The main issues we’re still having is with the automated deploy of the TDS packages using SitecorePackageDeployer, so I’m looking forward to your follow up!

    1. That was my feeling when building the process up, the information is there but scattered around. The follow post is nearly ready should have it up in the next few days.

Leave a Reply

Your email address will not be published. Required fields are marked *

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