Skip to content

Instantly share code, notes, and snippets.

View PaulStovell's full-sized avatar

Paul Stovell PaulStovell

View GitHub Profile
Typical Tentacle home directory (C:\Octopus on a web server, for example):
│ DeploymentJournal.xml
│ Tentacle-ApiTest-B.config
├───Applications
│ └───UAT
│ └───Acme.Web
│ ├───3.2.3
│ │ Default.aspx
CREATE TABLE [Account] (
[K] INTEGER IDENTITY(1,1) NOT NULL CONSTRAINT [IX_Account_K] UNIQUE CLUSTERED,
[Id] VARCHAR(50) NOT NULL CONSTRAINT [PK_Account_Id] PRIMARY KEY NONCLUSTERED,
[AccountType] VARCHAR(50) NOT NULL,
[Name] NVARCHAR(100) NOT NULL,
[EnvironmentIds] NVARCHAR(MAX) NOT NULL,
[JSON] NVARCHAR(MAX) NOT NULL
)
ALTER TABLE [Account] ADD CONSTRAINT [UQ_AccountUniqueName] UNIQUE([Name])
scriptcs.exe hello.csx -loglevel trace -output scriptcs.log

Communications between the Octopus Deploy server and Tentacles are secured using X.509 certificates. When Octopus is installed, a new self-signed certificate is generated. When Tentacles are installed, they also generate a new, self-signed certificate. In this post I'd like to discuss why we use self-signed certificates - after all, isn't that bad?

Background

When the Tentacle is registered in Octopus, the thumbprints (which identify the public key of the certificates) are exchanged - that is, you manually paste the Octopus thumbprint into the Tentacle setup wizard, and you manually verify the Tentacle's thumbprint in the Octopus UI. This screenshot is from Octopus 1.0 but the same concept exists in 2.6:

Exchanging thumbprints

When Octopus connects to a Tentacle, it verifies that the Tentacle presents a certificate with the thumbprint it expects. Likewise, when Tentacle hand

On the Octopus server

Octopus.Server.exe service --stop
Octopus.Server.exe configure --commsListenPort=10945
Octopus.Server.exe service --start

On Tentacle, find the Tentacle.config file, then find the Tentacle.Communication.TrustedOctopusServers section. You can change the address to use the port you want.

The SQL database table has 90,000 records.

Tested using:

ab.exe -c 1000 -n 1000 http://localhost:1234/
ab.exe -c 1000 -n 1000 http://localhost:1234/a

Output for synchronous version:

# Create arguments as an array
$args = @("create-release", "--project", "My Project")
# Dynamically add arguments
$environments = @("My Environment", "Production")
foreach ($environment in $environments)
{
$args += "--environment"
$args += $environment.Trim()
}
using System;
using System.IO;
using System.Threading;
namespace PackagingDeadlock
{
static class Program
{
// Set this to 100, and it works fine - all threads finish and exit
// Set it to 10000, however, and it deadlocks, as per: http://support.microsoft.com/kb/951731
Configuration SampleConfig
{
param ($ApiKey, $OctopusServerUrl, $Environments, $Roles, $ListenPort)
Import-DscResource -Module OctopusDSC
Node "localhost"
{
cTentacleAgent OctopusTentacle
{