Rails app for managing the transition of websites to GOV.UK. Specifically, it's for the production of and handling of mappings for use with Bouncer.
- Redis
- PostgreSQL 9.3+ (the app uses materialized views, which were introduced in 9.3). This is included in the Trusty dev VM, which is now the default.
bundle exec rake db:setup
FactoryBot will seed some dummy data to get started with.
bundle exec rake db:seed
The web application itself is run like any other Rails app, for example:
script/rails s
In development, you can run sidekiq to process background jobs:
bundle exec sidekiq -C config/sidekiq.yml
Available at /style, the guide documents how transition is using bootstrap, where the app has diverged from default styles and any custom styles needed to fill in the gaps.
This service is hosted on dxw's container platform called Dalmatian.
Deployments from this application's point of view are done by merging new code into either the develop branch for staging or the master branch for production. Once pushed DockerHub will build a new Docker Image.
Once complete, the deployment process to provision this new container hands over to Dalmatian.
This application has a separate private GitHub repository that is responsible for provisioning the required infrastructure. This includes the Bouncer service and is done using Terraform.
The way to deploy new containers is manual and involves downtime:
- Within AWS select the dxw-dalmatian-1 role
- Visit the ECS service
- Select the intended cluster (be careful as this cluster is shared)
- Click 'Tasks'
- Search by 'transition'
- Select all tasks running for the app in the intended environment
- Click 'stop'
- Those containers will restart and pull the new version of the containers
To access a Rails console or run a rake task on a live environment:
- Within AWS select the dxw-dalmatian-1 role
- Visit the Systems Manager service
- Select 'Session Manager'
- Click 'Start session'
- Select a running node for the intended environment
- Once the session has started enter
sudo su
- Enter
docker ps
- Copy the intended container ID from a container of the right application (be careful other containers are running here)
- Enter
docker exec -ti <container-id> /bin/bash
- Enter
eval $(AWS_ENV_PATH=/ukri-transition-0-staging/$SSM_PATH_SUFFIX/ AWS_REGION=eu-west-2 ./aws-env)
to load the environment variables - Enter
rails c
orrake
as normal