One of the things we’ve been working on with the Ministry of Justice is creating a consistent way for teams to build and deploy their applications.
This means that they can build new applications more quickly; it also means that developers working across different products can follow a tried and tested workflow process.
For context I’m going to talk about two tools in particular: Git and Docker.
Git is a version control system designed to make it easy to work on code in a team. The Ministry of Justice do their best to share as much code as possible, so most of what they write is published on GitHub.
One of the key features that GitHub gives, on top of just hosting the git repositories, is pull requests. Pull requests provide a great way to review code but also an excellent hook for integrations to run tests or builds of the new code.
Docker enables developers to package applications into ‘containers’ which can be tested and released in a consistent manner. Containers have been around in Unix based operating systems for a while. Recently, they’ve become a popular tool, partly due to Docker making containers easier to use on Linux. In addition they provide a nice abstraction layer on top of operating systems, making it easier to build once and deploy on any OS or virtual machine.
One thing that sets containers apart from other tools (or just plain virtual machines) is that they are based in layers which makes small changes quick to download and quick to start up.
This got us thinking, why not build a new Docker container each time a GitHub pull request is opened and then publish it to a test environment? This makes it possible to ‘see’ what’s being built before it is released.
To do this, we used Jenkins to build a new container using the GitHub pull request builder plugin to trigger the build.
We then publish the container to a demo environment and use Salt to configure a virtual host on nginx. This gives us a URL (like my-branch.domain.net) that anyone in the team can follow to see the new version in action. We also automatically post the URL in a team chat so that everyone in the team has visibility on changes to the application.
The same URL can also be used to test a feature with users before it’s released more widely.
One of the best things about this process is how it supports collaboration between designers, content editors, researchers and developers. Any feedback can be posted in the pull request before it is merged and released.
So far, two product teams at the Ministry of Justice are using this workflow, and they’re looking to introduce it more widely.
I’ll hopefully follow up with some technical details on how you could set this up yourself! Meanwhile, you can find some of the necessary salt states on GitHub https://github.com/ministryofjustice/moj-docker-deploy-formula
This post is adapted from the original on the MOJ Digital Blog
We work with our clients to de-risk and accelerate their business goals realisation. Our approach is based on tailoring our services to fit your needs leveraging our portfolio of strategy, execution, innovation and service delivery offerings to help you reach your objectives
We’re always on the lookout for exceptional talent and people who share our values. Even as we continue to grow, we maintain a family environment with respect and teamwork core to our culture.
Piotr Grześkowiak has been at Automation Logic for just over five years, starting out in our DevOps Academy after graduating in Computer Science with Information Security. During those 5 years, he’s gone from an engineer in training to a well respected senior engineer, trusted by the whole company. Piotr’s been on three Central Government client […]
We interviewed AL’s co-founders Kris & Norm about their journey building Automation Logic into the business it is over the last 12 years. From the values they’ve set in place, to the struggles they’ve faced. And obviously, because it’s pretty difficult not to mention it these days, the impact covid had.
A memoir of a Workload Migration engineer by Liam Rae-McLauchlan We’ve all read the blogs and articles about migrating to the Cloud and its benefits, but in practice it can be a daunting task. Maybe your organisation is planning to move to the cloud, or is already trying – up to 85% of enterprises are […]