Building a Continuous Integration Environment for Sitecore Part 4 – IIS

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

Assumptions

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

Getting Started

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

Create the following drives as they will be needed later

  • D:\Octopus
  • D:\Tools
  • D:\Websites

Preparation

I discussed briefly handle.exe and Package Installer in Part 2 but I want to take some time out to discuss them again

SysInternals Handle

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.

  • Sitecore.Client.dll
  • Sitecore.Kernel.dll
  • Sitecore.Logging.dll
  • Sitecore.Update.dll
  • Sitecore.Zip.dll

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

Project Build Properties

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.

System Accounts

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

teamcity_manageaccount1

Click “Add a user account”

SC_IIS01

I went with the Team OctopusManager to be consistent with the prior naming convention followed.

Click Next

SC_IIS02

Click Finish

Once the account has been created, click on “OctopusManager”

SC_IIS03

Click Change the account type

SC_IIS04

SC_IIS05

Select Administrator, and click Change Account Type

OctopusManager account must Administrator privilege

IIS

Run Server Manager,

From Manage drop down, select Add Roles and Features

SC_IIS08

Click Next on the Intro page

SC_IIS09

There is nothing wrong with ticking “Skip this page by default”

SC_IIS10

Select Role-based or feature-based installation and click Next

SC_IIS11

Select the server, from the list of the Server Pool and click Next

SC_IIS12

Scroll down the list of Roles and select Web Server (IIS)

SC_IIS13

Windows will inform you of what additional features are required. Ensure the Include management tools is ticked and click Add Features

SC_IIS14

Click Next

SC_IIS14

Click Next and add the features required.

SC_IIS15

I selected the following roles and features to install:

  • WebServer
    • Common HTTP Features
      • Default Document
      • Directory Browsing
      • HTTP Errors
      • Static Content
    • Health and Diagnostics
      • HTTP Logging
    • Performance
      • Static Content Compression
    • Security
      • 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

SC_IIS19

Verify that everything required is selected and click Install. Otherwise click Previous, and select again what is required.

SC_IIS20

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


C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis –i

The path is different if you are using 32bit version of windows

Next Steps

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

  • AppPool
  • Website

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.

Advertisements

My musing about anything and everything

Tagged with: , , , , ,
Posted in CI, Continuous Integration, IIS, Octopus, Octopus Deploy, Octopus Tentacle, Sitecore

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 9 other followers

%d bloggers like this: