Skip to content

Instantly share code, notes, and snippets.

@pauldougan
Last active September 12, 2024 20:29
Show Gist options
  • Select an option

  • Save pauldougan/4201579528761af65bd06fe4e2e7d093 to your computer and use it in GitHub Desktop.

Select an option

Save pauldougan/4201579528761af65bd06fe4e2e7d093 to your computer and use it in GitHub Desktop.
Run govuk-one-login/authentication-tech-docs locally

run-tech-docs.sh

A script to spin up a copy of the GOV.UK One Login technical documentation locally.

It clones the documenation repo into a temporary folder locally, fixes the version of ruby, installs dependencies and runs the Middleman server.

Review pages at http://localhost:4567 and http://localhost:4567/__middleman if you need the middleman dashboard

Dependencies

Assumes you have:

  • bash
  • git
  • curl
  • rbenv
  • ruby

Usage

Run it directly

bash -c "$(curl -fsSl https://gist.githubusercontent.com/pauldougan/4201579528761af65bd06fe4e2e7d093/raw/402d05ec715aa9935e8e434d8ed3db90b927917b/run-authentication-tech-docs.sh)"

Add a shell alias

alias run-govuk-one-login-tech-docs='bash -c "$(curl -fsSl https://gist.githubusercontent.com/pauldougan/4201579528761af65bd06fe4e2e7d093/raw/402d05ec715aa9935e8e434d8ed3db90b927917b/run-authentication-tech-docs.sh)"'

add to your ~/.bash_profile then type run-govuk-login-tech-docs at the command line

#!/usr/bin/env bash
# run the GOV.UK One Login tech docs locally from https://github.com/govuk-one-login/authentication-tech-docs
RUBY_VERSION=3.0.3
ORG=govuk-one-login
REPO=authentication-tech-docs
DIR=$(mktemp -d /tmp/${ORG}_${REPO}_XXXXXX)
echo $DIR
cd $DIR
git clone https://github.com/$ORG/$REPO
cd $REPO
rbenv local ${RUBY_VERSION}
eval "$(rbenv init - bash)"
rm Gemfile.lock
bundle install
bundle exec middleman server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment