From 227e3a37e584c994fc89f52247511f3b3dffaa3a Mon Sep 17 00:00:00 2001 From: Henare Degan Date: Wed, 17 Jan 2018 16:37:51 +1100 Subject: [PATCH] Add saving JS pages to static site build script https://github.com/everypolitician/viewer-sinatra/issues/15639 In d8b3c9fb and 4bb70eeb we added a way to generate some of our static pages after JavaScript had finished running. This commit adds this step into the static site generation build script. After `wget` has finished running this script overwrites some of the static files it generated with the (currently) few pages we want enhanced with JS. --- scripts/release.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/release.sh b/scripts/release.sh index 82cb68824..18b604baa 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -13,8 +13,11 @@ set -eo pipefail build_viewer_static() { bundle exec ruby app.rb & while ! nc -z localhost 4567; do sleep 1; done + SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd /tmp wget -nv -m localhost:4567/status/all_countries.html || (echo "wget exited with non-zero exit code: $?" >&2 && exit 1) + cd localhost:4567 + BUNDLE_GEMFILE=$SCRIPT_DIR/../Gemfile bundle exec $SCRIPT_DIR/save_javascript_pages.rb http://localhost:4567/javascript_pages_to_scrape.txt } deploy_viewer_static() {