Skip to content
This repository has been archived by the owner on Feb 4, 2020. It is now read-only.

alphagov/content-audit-tool

Repository files navigation

Content Performance Manager

Provide content designers across all of government with the data and tooling they need to measure and improve ‘their’ GOV.UK content.

This is an app that aggregates metrics from multiple sources to give easy view of content performance measurements.

Setting up the application

The application contains a setup script that will perform the steps required to bootstrap the application.

$ ./bin/setup

Running the application

Using the GDS development VM

See the getting started guide for instructions about setting up and running your development VM.

In the development VM, go to:

cd /var/govuk/govuk-puppet/development-vm

Then run:

bowl content-audit-tool

The application can be accessed from:

http://content-audit-tool.dev.gov.uk

To run the test suite:

$ bundle exec rake

or you can also use Guard, see list commands

$ bundle exec guard

Using Docker

Docker configuration files are included should you wish to develop the application in a container. A compose configuration is included that defines all the services needed to run the application.

Use the GOV.UK replication scripts to download a copy of the application data:

$ cd /path/to/govuk-puppet/development-vm/replication/
$ ./sync-postgresql.sh -n postgresql-primary-1.backend.integration

Set an environmental variable pointing to the PostgreSQL backup. This is then mounted as a volume on the PostgreSQL container so that the application database is restored when the container is created. See the official PostgreSQL Docker image for more information.

$ echo "DATABASE_BACKUP=/path/to/govuk-puppet/development-vm/replication/backups/postgresql/postgresql-primary-1.backend.integration/latest/content_audit_tool_production_XXXX-XX-XX_XXhXXm.Day.sql.gz" > .env

Create and start the containers:

$ docker-compose up -d

Apply any database migrations created after the database import was taken:

$ docker-compose exec app rails db:migrate

Launch the application:

$ open http://localhost:3000/

To run the test suite:

$ docker-compose exec app rails db:setup RAILS_ENV=test
$ docker-compose exec app rake

App development