From f42f6b4ac0f31356e80f154c11dc0dbe3d09da36 Mon Sep 17 00:00:00 2001 From: Oliver Byford Date: Tue, 23 Apr 2024 12:13:07 +0100 Subject: [PATCH] Remove unused deploy script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Once upon a time we included a deploy script when creating a site from the tech docs template if you said you were going to be deploying to PaaS [1]. We also now deploy to GitHub Pages instead of PaaS (And, as far as I can tell we’ve never used it – the deploy has always been handled by GitHub Actions or Concourse.) So delete the unused deploy script. [1]: https://github.com/alphagov/tech-docs-template/blob/main/optional/script/deploy --- script/deploy | 55 --------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 script/deploy diff --git a/script/deploy b/script/deploy deleted file mode 100644 index 758857ca..00000000 --- a/script/deploy +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash - -set -e - -error() { - echo " ! $1" -} - -# Check that we have a Staticfile.auth we can use -echo "Checking Staticfile.auth..." -if [[ ! -f Staticfile.auth ]]; then - error "You are attempting to deploy to an environment that requires a Staticfile.auth, but do not have one locally." - error "Please add a Staticfile.auth file to this directory and try again." - error - error "For information on generating a Staticfile.auth, see" - error "http://docs.cloudfoundry.org/buildpacks/staticfile/index.html#basic-auth" - exit 1 -fi -echo "OK!" - -# Check that we're on main, or there's an environment variable set to override -BRANCH=$(git rev-parse --abbrev-ref HEAD) - -echo "Checking branch..." -if [[ $BRANCH != "main" ]] && [[ $I_REALISE_I_AM_NOT_ON_MAIN != "y" ]]; then - error "Current branch is not main, cowardly refusing to deploy" - error "To force override, run this again with I_REALISE_I_AM_NOT_ON_MAIN=y" - exit 1 -fi -echo "OK!" - -# Check that we've not got any uncommitted files in our working directory -echo "Checking dirty working tree..." -DIRTY_WORKING_TREE=$(git status --porcelain 2>/dev/null | egrep "^(M| M)" || exit 0) -if [[ $DIRTY_WORKING_TREE != "" ]]; then - error "There are uncommitted changes in the working directory." - error "Please commit or stash all changes and try again." - exit 1 -fi -echo "OK!" - -# Check if we're behind our Git remote -echo "Checking if we're behind origin..." -BEHIND_ORIGIN=$(git fetch origin >/dev/null 2>&1; git diff --stat HEAD...@{u}) -if [[ $BEHIND_ORIGIN != "" ]]; then - error "You are behind the origin branch - please pull and try again." - exit 1 -fi -echo "OK!" - -bundle exec middleman build -cp Staticfile.auth build -cp nginx.conf build -cf target -o govuk-service-manual -s integration -cf push