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.
Companies can start deploying containerised workloads to Kubernetes In days not months, by leveraging Automation Logic’s Kubernetes Platform Accelerator.
Largest Irish-Founded Tech Employer Surpasses 3000 Employees Signing 15th and 16th Acquisition Deals Version 1, a leading digital transformation partner, is to acquire Automation Logic – for an undisclosed sum as part of its ambitious growth strategy for 2023 and beyond. The Automation Logic deal is subject to clearance by the National Security and Investment […]
Automation Logic were recognised as one of the UK’s best Workplaces again for the 5th year running! We also placed 29th in best workplaces for women. This highlights the great work that we are doing as a business, including all the wonderful work being put in by the employee-led DE&I groups. This award means so […]