diff --git a/build-trumped.com.sh b/build-trumped.com.sh new file mode 100755 index 0000000000..6cfd3bc110 --- /dev/null +++ b/build-trumped.com.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# NB: This file is executed by Netlify to build trumped.com + +set -euxo pipefail + +# Add the GIT SHA to the build +# This must be done before everything else, or it will get cached with the build. +# (This might be making the builds less performant?) +# COMMIT_REF is defined by Netlify to be the commit SHA +# We want a short 8 character reference. +echo "Labelling build with short SHA..." +SHORT_SHA=$(echo "${COMMIT_REF}" | cut -c1-8) +find . -type f -exec sed -i "s/CURRENT_STORYTELLER_VERSION/${SHORT_SHA}/g" {} + +# The above command won't work with Mac's version of find/sed. The following is a Mac-friendly version: +# find . -type f -exec sed -i '' -e "s/CURRENT_STORYTELLER_VERSION/${SHORT_SHA}/g" {} + + +# --ignore-engines: https://stackoverflow.com/a/59615348 +yarn build-trumped --verbose --ignore-optional --ignore-engines + +mkdir trumped.com +mv packages/trumped.com/build/ trumped.com/build/ + +echo "Copying redirects configuration to Netlify build dir..." +cp _redirects trumped.com/build/ + diff --git a/packages/trumped.com/src/modes/speak/Form.tsx b/packages/trumped.com/src/modes/speak/Form.tsx index b8c1961593..fa68434795 100644 --- a/packages/trumped.com/src/modes/speak/Form.tsx +++ b/packages/trumped.com/src/modes/speak/Form.tsx @@ -1,7 +1,6 @@ import Howl from 'howler'; import React from 'react'; import { getRandomInt } from '../../Utils'; -import { SpeakRequest } from './SpeakRequest'; const AUDIO_FILES = [ '/wav/fakeyou_1.wav', diff --git a/publish_production_trumped.sh b/publish_production_trumped.sh new file mode 100755 index 0000000000..8fafb8d67f --- /dev/null +++ b/publish_production_trumped.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -euxo pipefail + +MASTER_BRANCH='master' +PRODUCTION_BRANCH='production-trumped' + +git stash +git checkout $MASTER_BRANCH +git pull + +if git show-ref --verify --quiet "refs/heads/$PRODUCTION_BRANCH"; then + echo "Deleting branch ${PRODUCTION_BRANCH}" + git branch -D $PRODUCTION_BRANCH +fi + +git checkout -b $PRODUCTION_BRANCH +git push --set-upstream origin $PRODUCTION_BRANCH + +git checkout $MASTER_BRANCH +