From 9de377d0811159ad5e2a0da0fa0162cea3221dce 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 In previous commits 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 Rake task overwrites some of the static files it generated with the (currently) few pages we want enhanced with JS. --- .travis.yml | 2 +- scripts/release.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c911f5d2f..146bebeb2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ addons: - cmake script: - xvfb-run bundle exec rake - - travis_wait 30 scripts/release.sh + - travis_wait 30 xvfb-run scripts/release.sh - bash <(curl -fsSL https://github.com/everypolitician/ensure-regression-tests/raw/master/ensure-regression-tests) sudo: false rvm: diff --git a/scripts/release.sh b/scripts/release.sh index 82cb68824..7e4b23212 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 + REPO_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=$REPO_DIR/Gemfile bundle exec rake -f $REPO_DIR/Rakefile generate_static_site_javascript_pages } deploy_viewer_static() {