Skip to content
WIP - Future publisher of content on GOV.UK
Branch: master
Clone or download
Latest commit 4ba817a Mar 20, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
config Rescue from GdsApi::BaseError and create a publishing_api down spec Mar 19, 2019
docs Assign ADR 9 Mar 7, 2019
log Bare Rails application Jul 10, 2018
public Fix links to error.css Aug 21, 2018
spec Rescue from GdsApi::BaseError and create a publishing_api down spec Mar 19, 2019
tmp Bare Rails application Jul 10, 2018
.rspec Add rspec-rails and useful testing tools Jul 10, 2018
.rubocop.yml Turn off the Rails/HasManyOrHasOneDependent cop Jan 22, 2019
.ruby-version Update .ruby-version to 2.6.1 Feb 13, 2019
Gemfile.lock Bump govuk_app_config from 1.12.0 to 1.13.0 Mar 19, 2019
Procfile Install sidekiq for background job processing Mar 4, 2019 Update byebug listener ports Mar 4, 2019
app.json Make it work with Heroku again Dec 4, 2018

Content Publisher

A unified publishing application for content on GOV.UK


  • Content - Some text (and related fields) a user wants to publish
  • Revision - A version of a piece of content in a particular locale
  • Edition - A revision that is in the Publishing API
  • Document - All revisions of a piece of content in a particular locale

Technical documentation

This is a Ruby on Rails application.


  • postgresql - provides a backing database
  • redis - used as a storage layer for asynchronous job processing
  • yarn - package manager for JavaScripts
  • imagemagick - image manipulation library

Running the application

The first time you run this application you'll want to set you permissions.

Then, if you are running on the GOV.UK development VM:

cd /var/govuk/govuk-puppet/development-vm
bowl content-publisher

You should be able to access the app at:

Otherwise, on your machine:


Running the test suite

yarn install
bundle exec rake

Running JavaScript tests only

Running Jasmine tests in local web browser

bundle exec rake jasmine

Running Jasmine tests in console

bundle exec rake jasmine:ci

Debugging the application

This application uses byebug for debugging. A breakpoint can be inserted by inserting a line of byebug into the ruby code.

As this application is run via foreman it is not easy to interact with the debugger via the running processes. Instead the debugger should be accessed by creating a remote debugging session with byebug and listening. This can be done by running the following in a separate terminal window:

bundle exec byebug -R localhost:3237

which will listen for the web application. Substitute port 3237 for 3238 to listen to the sidekiq processes.


Functionality of this application is enabled with permissions. There is a pre_release_features permission, for using functionality not yet available to users, and there is a debug permission, to access debug and documentation in app.

To enable these permissions in a development environment run:

bundle exec rake developer_permissions

To enable them for your GOV.UK account add them to your account in signon.

Importing Whitehall news documents

To populate your local database with Whitehall content there is a task in Whitehall to export data and a task in Content Publisher to import that output.

To export from Whitehall, you need to have a cloned copy of Whitehall with a populated database, cd into the whitehall directory and run:

bundle exec rake export:news_documents 2>&1 | grep created_at > /tmp/whitehall-export.json

This will take a while to run (~30 mins), this can be reduced by limiting the output with filters

To import this exported file into Content Publisher, you need to cd into the content publisher directory and run:

bundle exec rake import:whitehall_news INPUT=/tmp/whitehall-export.json

User support


MIT License

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.