2017-04-01 08:09:39 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# WARNING: FIREBASE_TOKEN should NOT be printed.
|
|
|
|
set +x -eu -o pipefail
|
|
|
|
|
|
|
|
|
|
|
|
FIREBASE_PROJECT_ID=aio-staging
|
2017-03-31 19:24:25 -04:00
|
|
|
DEPLOYED_URL=https://$FIREBASE_PROJECT_ID.firebaseapp.com
|
2017-04-01 08:09:39 -04:00
|
|
|
|
2017-05-12 15:07:51 -04:00
|
|
|
(
|
|
|
|
cd "`dirname $0`/.."
|
2017-04-01 08:09:39 -04:00
|
|
|
|
2017-05-12 15:07:51 -04:00
|
|
|
# Build the app
|
|
|
|
yarn build
|
2017-04-01 08:09:39 -04:00
|
|
|
|
2017-05-12 15:07:51 -04:00
|
|
|
# Deploy to staging
|
|
|
|
firebase use "$FIREBASE_PROJECT_ID" --token "$FIREBASE_TOKEN"
|
|
|
|
firebase deploy --message "Commit: $TRAVIS_COMMIT" --non-interactive --token "$FIREBASE_TOKEN"
|
2017-04-01 08:09:39 -04:00
|
|
|
|
2017-05-12 15:07:51 -04:00
|
|
|
# Run PWA-score tests
|
|
|
|
# TODO(gkalpak): Figure out why this fails and re-enable.
|
|
|
|
sleep 10
|
|
|
|
yarn test-pwa-score -- "$DEPLOYED_URL" "$MIN_PWA_SCORE" || true
|
|
|
|
)
|