“We will work as one. ‘Tis a new world. Humanity needs the skills that my technology will give them.”
Otto Octavius aka. Dr. Octopus
Most of the projects and products we create here at Code are delivered by placing them on a hosting server that provides online accessibility to the client and, ultimately, the end user — allowing it to be consumed, used and interacted with. Depending on the complexity of a given project, we may choose to sit the product across multiple hosting servers, each specialising in a different technology (for example, database, caching or content management).
In order for our products to leave the ‘shop floor’, we need to go through a deployment process, where all files (including code files, images, styles and documents) relevant to a project are moved from development to a prepared live server or servers. As you’d expect, this isn’t a simple copy and paste job, as we need to run our projects through rigorous procedures and tests to ensure functionality is sound, performance is optimised and the solution is clean and ready for the host server.
Where possible, we favour automating these processes to minimise the room for error and ensure subsequent deployments are fast and reliable.
One tool that we’ve found to be invaluable in this regard is Octopus Deploy, a robust product that allows the steps and processes that go into a deployment to be easily configured and modified as the project is built. The dream of the Octopus Deploy creator, Paul Stovell, is to enable one click deployments that completely remove any worries around things going wrong.
The technical bit: How Octopus Deploy works
A typical website project would usually involve a number of stages set across different servers — development, staging and production. During the build of a feature, our developers will peer review code and commit changes to a version control system. This allows them to save work centrally and collaborate on any changes that need to be made. This code will then go through a series of automated tests on our TeamCity continuous integration server.
The continuous integration server is configured to package up the code and associated files into a NuGet artefact; NuGet is a package manager that integrates well with Microsoft .Net solutions, and an artefact is essentially like a standardised zip file that contains further data detailing contents and how it should be used.
This NuGet artefact is made available to the Octopus server, which can then send the package to the desired host server. In order for Octopus to communicate with the external server, a small auxiliary software package must be installed on the host. This is rather fetchingly named the Octopus Tentacle.
Next, the Octopus server must conduct a handshake with the remote Tentacle. This is the process that allows them to connect securely. Octopus will then upload the package and carry out any specific configuration that has been pre-set for that particular server (for example, the development server would have different performance and debug settings that would not be present in the production server). Each project will have many such settings and Octopus is configured to sort all these out for us.
The great thing about Octopus is that it allows all the hard work to take place upfront. The configuration does take time, but the result is that we have a robust deployment procedure that is less prone to human and technological error.
In the past, we have configured release processes with more verbose and cumbersome tools which did the job but were difficult to maintain and had a steep learning curve for our graduate developers. The beauty of Octopus Deploy is its ability to tie together these old configurations and split them into easy-to-digest chunks that allow us to adapt quickly to changes as either the server or project matures and evolves.
In total we currently have 58 projects running through our continuous integration server, with a total of 215 build configurations. That equates to 22 Octopus Deploy setups deploying across a total of 28 servers. A real testament to how much we love this tool.
The benefits of implementing Octopus Deploy are that we can be more nimble with our deployments as most of the hard work has been pre-configured. This is particularly helpful when we’re working with clients who need to adapt to the change of the online climate quickly and efficiently.