Skip to content

Instantly share code, notes, and snippets.

@pauldougan
Last active February 15, 2024 23:24
Show Gist options
  • Select an option

  • Save pauldougan/45088a81c2f6b9f97447cf014e79aa49 to your computer and use it in GitHub Desktop.

Select an option

Save pauldougan/45088a81c2f6b9f97447cf014e79aa49 to your computer and use it in GitHub Desktop.
run-govuk-protoptype-kit

run-govuk-prototype-kit.sh

A script to spin up an ephemeral copy of the GOV.UK One prototye kit locally.

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

Review pages at http://localhost:3000

Dependencies

Assumes you have:

  • bash
  • git
  • curl
  • nvm
  • node

Usage

Run it directly

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

Add a shell alias

alias run-govuk-prototype-kit='bash -l -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-prototype-kit 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
ORG=alphagov
REPO=govuk-prototype-kit
NODE_VERSION=20.11.0
DIR=$(mktemp -d /tmp/${ORG}_${REPO}_XXXXXX)
echo $DIR
cd $DIR
git clone https://github.com/$ORG/$REPO
cd $REPO
nvm use $NODE_VERSION
npm install
npm run start:dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment