Skip to main content

This blog post was published under the 2010-2015 Conservative and Liberal Democrat coalition government

https://mojdigital.blog.gov.uk/2014/03/25/managing-the-consistency-challenge-across-moj-services/

Managing the consistency challenge across MOJ services

Posted by: , Posted on: - Categories: Development

As the number of projects that we’re working on began increasing, we realised that we needed a better way of managing dependencies and style consistency.

Introducing the MOJ template

The result has been that our frontend development team has created a MOJ Template to help manage this across multiple languages and platforms. The template is a Ruby on Rails engine that compiles and packages a layout with accompanying assets into various different syntaxes. This allows us to manage any global changes to the layout in just one place and then publish a new version of the template in various different formats.

We currently support the following formats:

  • Ruby Gem for Ruby on Rails projects hosted on Rubygems
  • Python Package for Django projects hosted on PyPi
  • A Play Framework template
  • A Mustache template
  • A Mustache Inheritance template

For instructions on using any of these formats, please view the readme in the GitHub repository.

Working with the GOV.UK template

Behind the MOJ Template is the GOV.UK Template. Supported by GDS, it is structured in a very similar way and manages the look of the basic GOV.UK header and footer. This dependency enables us to easily filter any major updates to the basic layout into all of our services using the MOJ template.

We have also linked the MoJ template to our instance of Jenkins CI. This allows us to run our tests on any new pull requests created in GitHub to ensure that the proposed changes don’t break anything. Once a pull request is accepted and merged into the master branch another job is run in Jenkins to automatically release a new version to RubyGems and PyPi.

We tag each revision using Semantic Versioning so that projects with a dependency on the hosted packages can continue by using a specific version number.

Sharing and comments

Share this page

Leave a comment

We only ask for your email address so we know you're a real person

By submitting a comment you understand it may be published on this public website. Please read our privacy notice to see how the GOV.UK blogging platform handles your information.