Cowboy in the desert.

Calamari: open sourcing Tentacle deployments

Paul Stovell

I wrote recently about the new deployment targets coming as part of Octopus 3.x, and I explained that we'd be turning Tentacle into a "shell":

From 3.0 onwards, think of Tentacle as a Windows-oriented version of SSH, except with support for both polling and listening modes. All it knows how to do is to execute PowerShell scripts, or transfer files. Everything else - the config transform stuff, the IIS stuff - will be PowerShell scripts that Octopus will ensure exist on the Octopus server prior to deployments executing.

That lead to a logical conclusion:

Now that we're decoupling Tentacle the communication channel from Tentacle the deployment engine, we gain a new possibility: all the scripts and deployment logic that Tentacle executes during a deployment can now be open sourced

Making this happen has been our main focus over the last couple of months, and has manifested as Calamari, the open-source, convention-driven deployment runner:

Calamari GitHub repository

Since we started, we've believed that deployment pipelines take a significant time investment and become critical to how teams operate. For that reason, it's very important to avoid vendor lock-in. Octopus has always been built on open/standard technologies, like NuGet and PowerShell, to minimize your dependencies on Octopus - open sourcing Calamari and all the conventions we use during a deployment is a natural evolution of that goal.

Calamari is a console application with a number of commands, for example:

Calamari deploy-package --package MyPackage.nupkg --variables Variables.json

The package is a NuGet package, and the variables JSON file looks like this:

{
    "MyVariableA": "My value A",
    "MyVariableB": "My value B"
}

Deployments now work like this:

  1. Octopus acquires packages and generates the variables file
  2. These are pushed to Tentacle
  3. Tentacle is told to run a PowerShell script which just invokes Calamari
  4. Calamari takes care of the deployment, and terminates

Now that Calamari is open source, it might help to answer any questions you had around what happens during a deployment on a Tentacle. For example, did you ever wonder what order conventions run in?

Conventions

Or maybe you always wondered how Tentacle (now Calamari) calls PowerShell, and passes variables to it?

Calamari is published under the Apache license, and we'll continue to work on it in the open. One of my favourite features of this architecture is that you can fork the project, make your own changes, and then tell your Octopus 3.0 server to use your own Calamari package.


Tagged with: Architecture
Loading...