From e4e44ae8d76496f406d5b3f722744ffa4db68376 Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Fri, 27 Sep 2019 17:33:37 -0700 Subject: [PATCH] Fix deploy script - Do Yarn install before webpack build - Exit on error --- scripts/deploy-website.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/deploy-website.sh b/scripts/deploy-website.sh index c4218e51d9..11a5636d84 100755 --- a/scripts/deploy-website.sh +++ b/scripts/deploy-website.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + PUBLIC_PATH="${PUBLIC_PATH:-/react-router/}" root_dir="$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)")" @@ -12,16 +14,17 @@ git clone --depth 2 --branch master "git@github.com:ReactTraining/reacttraining. # Build the website into the static/react-router dir rm -rf "$tmp_dir/static/react-router" cd "$root_dir/website" -yarn build -- --output-path "$tmp_dir/static/react-router" --output-public-path $PUBLIC_PATH +yarn +yarn build --output-path "$tmp_dir/static/react-router" --output-public-path $PUBLIC_PATH # Commit all changes cd $tmp_dir git add -A git commit \ + --author "Travis CI " \ -m "Update react-router website -https://travis-ci.org/$TRAVIS_REPO_SLUG/builds/$TRAVIS_BUILD_ID" \ - --author "Travis CI " +https://travis-ci.org/$TRAVIS_REPO_SLUG/builds/$TRAVIS_BUILD_ID" # Deploy git push origin master