This is part 4 of the series of post that I am doing about building a Continuous Integration Environment using Sitecore, TeamCity, Octopus Deploy, and Unicorn.
Part 1 – Setting Up TeamCity
Part 2 – Setting up OctopusDeploy
Part 3 – Setting up SQL Server for Sitecore
Part 4- This post
Part 5 – Octopus Environment and Deployment Configuration
Part 6 – TeamCity Project
Part 7 – OctopusDeploy Project
Part 8 – Sitecore Item Synchronization using Unicorn
Part 9 – Displaying Build number on Sitecore Home Page & Tagging Git
Part 10 – config transformations using Octopus Deploy
Part 11 – Deploying to a Sitecore Multi-Instance Configuration
Just a quick reminder
All the servers are running Windows Server 2012 R2.All the servers are stand alone, and are not part of a domain. All servers have C and D drives.
Everything that is documented here and on subsequent posts are based on freshly installed Windows Servers.
As detailed in Part 1, you will need to modify the Local Security Policy so that password don’t expire after 42 days
This post will just be installing and performing minor configuration of IIS. Everything else, the creation of the Sitecore website, etc will be performed in a later post where I create the Octopus project
Before starting download the following software. It will be used during this setup
- Octopus Tentacle At the time of installation I used file Octopus.Tentacle.3.3.1-x64.msi
- Windows Sysinternals Handle
- PackageInstaller from VGBenjamin
Create the following drives as they will be needed later
I discussed briefly handle.exe and Package Installer in Part 2 but I want to take some time out to discuss them again
This is handy little utility that is used to release locks on files. Previously I have experienced problems whereby even if stopped the AppPool and an IIS Site, locks where still being held on files, and you could not do a deployment. Using this utility it would force all handles that are still open on a file to be closed. It will be used later as a deployment step with Octopus. For now just Extract the downloaded zip file to D:\tools\Handle
Sidewalk Package Installer
This handy utility on GitHub allows you to install Sitecore Packages from the Command Line. Perfect for when you want to automatically deploy using powershell.
The following steps should be performed on a development machine, and once completed the files should be placed on a central location.
Clone the GitHub repo: https://github.com/VGBenjamin/PackageInstaller.git
Copy the following sitecore .dll’s of the version of sitecore you are using.
For Sitecore 8.0 and above, download from dev.sitecore.net and for versions prior to 8.0 download from sdn.sitecore.net. Just remember only a Certified Sitecore Developer will be able to access these sites and have the ability to download files.
Where the solution was cloned to, create a folder, Libraries, and past in the list of files from the correct version of Sitecore.
Open the solution within Visual Studio
Ensure that for each project, the Target Framework is .NET Framework 4.5
Restore missing NuGet packages and do a release build.
If you get build errors about Sitecore files missing, its because he solution expects these files to be in the Libraries folder. If you get compile errors, then the path to the Sitecore files is incorrect. Update where relevant
Copy all files from PackageInstaller\Sidewalk.SC.PackageInstaller.Client\bin\Release (on dev machine) to D:\Tools\SidewalkPackageInstaller.7.2
This path must be correct as it is used by the Octopus Deployment process to deploy Sitecore Modules. Incorrect path will cause the deployment to fail.
As before, need to create an Administrator account for the Octopus Tentacle that will be installed.
From Control Panel select User Accounts | Manage another Account
Click “Add a user account”
I went with the Team OctopusManager to be consistent with the prior naming convention followed.
Once the account has been created, click on “OctopusManager”
Click Change the account type
Select Administrator, and click Change Account Type
Run Server Manager,
From Manage drop down, select Add Roles and Features
Click Next on the Intro page
There is nothing wrong with ticking “Skip this page by default”
Select Role-based or feature-based installation and click Next
Select the server, from the list of the Server Pool and click Next
Scroll down the list of Roles and select Web Server (IIS)
Windows will inform you of what additional features are required. Ensure the Include management tools is ticked and click Add Features
Click Next and add the features required.
I selected the following roles and features to install:
- Common HTTP Features
- Default Document
- Directory Browsing
- HTTP Errors
- Static Content
- Health and Diagnostics
- HTTP Logging
- Static Content Compression
- Request Filtering
- Application Development
- .NET Extensibility 4.5
- ASP.NET 4.5
- ISAPI Extensions
- ISAPI Filters
- Management Tools
- IIS Management Console
Once you have selected everything, got the summary dialog confirming what is about to be installed
Verify that everything required is selected and click Install. Otherwise click Previous, and select again what is required.
Once installation has been completed, click Close button
Previoulsy i have had issues where asp.net does not seem to be installed correctly, or was causing problems. Especially if you added itt in after initially installing IIS. Therefore to ensure that everything is set up correctly for asp.net, run a command prompt elevated as an administrator, and execute the following command
The path is different if you are using 32bit version of windows
There is nothing further to configure as the Octopus Deploy project that will be created will do all that is required for the solution. This includes but not limited to
I don’t want to involve the Unicorn Sync process yet, so the next steps are going to be building the TeamCity build solution, and the Octopus Deploy project.