Building a Continuous Integration Environment for Sitecore Part 5 – Octopus Configuration

This is part 5 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 – IIS
Part 5 – This post
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.

There is still a lot of work to do, but now all the basics are in place

What is coming is

  • Creating the deployment environments in OctopusDeploy
  • Creating the TeamCity Project that will generate the Nuget packages for the deployment
  • Using Unicorn to sync the changes made within Sitecore

Setting up a lot of the above will involve jumping between between applications and environments, and because of this the process can appear haphazard, or downright strange at times. But it will all work out in the end.

Octopus Environments

Start the Octopus Deploy Web Portal, and select Environments

oct_env01

Click Add environment

oct_env02

As this is for the initial CI environment, I named the environment CI

Click Save.

oct_env03

Click Add deployment target

oct_env04

Select Listening Tentacle

oct_env05

At this point, leave the browser open, but the Octopus Tentacle now needs to be installed on the IIS Server that was set up in Part 4

Make a note of the thumbprint as it will be needed during the installation of the tentacle.

There is another way to get this value.

Select Configuration | Certificates

oct_tentacle01

Octopus Tentacle On IIS Server


This step is to be performed on the IIS server.
This will install the tentacle that will be used by Octopus Deploy for deploying applications.
It will not install a full copy of Octopus Deploy.
Ensure you are not installing Octopus Deploy by mistake

Run Octopus.Tentacle.3.3.1-x64.msi

SC_IIS_Oct01

Click Next

SC_IIS_Oct02

Accept the Licence Agreement and click Next

SC_IIS_Oct03

Accept the default location and click Next

SC_IIS_Oct04

Click Install

SC_IIS_Oct05

Click Finish

The installation will ensure that you have Powershell v2 installed. With Windows 2012 R2, the version of Powershell installed should already be v4.

SC_IIS_Oct06

Click Get Started

SC_IIS_Oct07

At the welcome screen, click Next

oct_tentacle07

On the Tentacle configuration, change the value to D:\Octopus, and D:\Octopus\Applications respectively

Click Next

SC_IIS_Oct09

Ensure that select a Listening Tentacle, and click Next

SC_IIS_Oct10

Use the default port, and leave the Add Windows Firewall exception ticketed.

Add in the thumbprint / certificate from the Octopus Deploy server that you determined before starting the installation, and copy it into the Octopus Thumbprint

SC_IIS_Oct12

Click Next

SC_IIS_Oct13

As this point you can view the powershell script that will be used to install the tentacle. or just click Install

SC_IIS_Oct14

You will see the progress of the installation. Once completed click Finish

The Tentacle Manage will start automatically. If not it can be run from the Start Menu / Tiles

SC_IIS_Oct15

OctopusDeploy Tentacle Service

I want to change the account that the Octopus Deploy Tentable service is running as. The service’s Log On As value defaults to Local System

Start View Local Services

SC_IIS_Oct16

Scroll down and select OctopusDeploy Tentacle

  • Stop the Service
  • Edit Properties
  • Go to the Log On tab.
  • Change the Log on as from Local System to OctopusManager administrator account created during Step 4
  • You will be presented with dialog confirming that the OctopusManage account has been granted the Log On As A service right.

    SC_IIS_Oct17

  • Start the Service

Completing Octopus Environments Configuration

Now that the tentacle has been installed, Octopus needs to know about this machine.

Return to the Web Portal web deployment where it was left earlier

oct_env05

Enter the host name ( ip address ) of the IIS Server, and click Discover. After a short pause, the server should be successfully discovered and you will be on the Deployment target settings

oct_env06

The Thumbprint will match the Thumbprint from the Tentacle Manager on the IIS server
For Display Name enter CI
Leave Environments as CI
For Roles enter CD and CM respectivaly. These are new roles and you will be prompted to create new role for each.

oct_env07

Click Save

oct_tentacle04

You are taken back to the environments page.

Refresh this page until you get the message about needing to update Calamari on the CI Environment.

oct_tentacle05

Click Update Calamari on this machine. This will start a task. Once successfully completed you should see the screen below

oct_tentacle06

Completing Octopus Lifecycle Configuration

In Part 2 we creating an initial Lifecycle. Now that we have the environment and deployment machine created, its time to complete the lifecycle configuration.

Within the Octopus Deploy Web portal, select Library Lifecycles

oct_lc01

Click the name of the lifecycle

oct_lc02

Click Add phase

oct_lc03

I named this phase CI and then click Add environment

oct_lc04

From the drop down list, select the CI environment that has just been created, and select “Deploy automatically to this environment as soon as the release enters this phase”

Click Add

oct_lc05

Now that back on the Lifecycle page, click Save.

Next Steps

Now that the environments are set up, its time to switch back to TeamCity and create the build project to be used. This is detailed in Part 6

Advertisements

My musing about anything and everything

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

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 12 other followers

%d bloggers like this: