Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.
/ transition Public archive
forked from alphagov/transition

Managing mappings (eg redirects) for sites moving to GOV.UK.

License

Notifications You must be signed in to change notification settings

dxw/transition

 
 

Repository files navigation

Transition

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.

Dependencies

  • 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.

Set up the database

bundle exec rake db:setup

Seed the database

FactoryBot will seed some dummy data to get started with.

bundle exec rake db:seed

Running the app

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

Style guide

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.

Deployments

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.

Dalmation

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:

  1. Within AWS select the dxw-dalmatian-1 role
  2. Visit the ECS service
  3. Select the intended cluster (be careful as this cluster is shared)
  4. Click 'Tasks'
  5. Search by 'transition'
  6. Select all tasks running for the app in the intended environment
  7. Click 'stop'
  8. Those containers will restart and pull the new version of the containers

Access the console

To access a Rails console or run a rake task on a live environment:

  1. Within AWS select the dxw-dalmatian-1 role
  2. Visit the Systems Manager service
  3. Select 'Session Manager'
  4. Click 'Start session'
  5. Select a running node for the intended environment
  6. Once the session has started enter sudo su
  7. Enter docker ps
  8. Copy the intended container ID from a container of the right application (be careful other containers are running here)
  9. Enter docker exec -ti <container-id> /bin/bash
  10. Enter eval $(AWS_ENV_PATH=/ukri-transition-0-staging/$SSM_PATH_SUFFIX/ AWS_REGION=eu-west-2 ./aws-env) to load the environment variables
  11. Enter rails c or rake as normal

About

Managing mappings (eg redirects) for sites moving to GOV.UK.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 70.4%
  • HTML 13.9%
  • Gherkin 7.6%
  • JavaScript 4.8%
  • SCSS 3.1%
  • Dockerfile 0.2%