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
Click Add environment
As this is for the initial CI environment, I named the environment CI
Click Save.
Click Add deployment target
Select Listening Tentacle
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
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
Click Next
Accept the Licence Agreement and click Next
Accept the default location and click Next
Click Install
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.
Click Get Started
At the welcome screen, click Next
On the Tentacle configuration, change the value to D:\Octopus, and D:\Octopus\Applications respectively
Click Next
Ensure that select a Listening Tentacle, and click Next
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
Click Next
As this point you can view the powershell script that will be used to install the tentacle. or just click Install
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
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
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
- Start the Service
You will be presented with dialog confirming that the OctopusManage account has been granted the Log On As A service right.
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
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
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.
Click Save
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.
Click Update Calamari on this machine. This will start a task. Once successfully completed you should see the screen below
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
Click the name of the lifecycle
Click Add phase
I named this phase CI and then click Add environment
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
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
Leave a Reply