Skip to content

Commit

Permalink
Add saving JS pages to static site build script
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
henare committed Jan 23, 2018
1 parent c31f4b2 commit 9de377d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 9de377d

Please sign in to comment.