diff --git a/aio/package.json b/aio/package.json index 0b2368da6c..7db2bb4eb6 100644 --- a/aio/package.json +++ b/aio/package.json @@ -14,15 +14,13 @@ "pree2e": "yarn ~~update-webdriver", "e2e": "yarn check-env && ng e2e --no-webdriver-update", "deploy-preview": "scripts/deploy-preview.sh", - "deploy-staging": "firebase use staging --token \"$FIREBASE_TOKEN\" && yarn ~~deploy", + "deploy-staging": "scripts/deploy-staging.sh", "check-env": "node ../tools/check-environment.js", "predocs": "rimraf src/content", "docs": "dgeni ./transforms/angular.io-package", "docs-lint": "eslint --ignore-path=\"transforms/.eslintignore\" transforms", "docs-test": "node ../dist/tools/cjs-jasmine/index-tools ../../transforms/**/*.spec.js", "~~update-webdriver": "webdriver-manager update --standalone false --gecko false", - "pre~~deploy": "yarn build", - "~~deploy": "firebase deploy --message \"Commit: $TRAVIS_COMMIT\" --non-interactive --token \"$FIREBASE_TOKEN\"", "boilerplate:add": "node ./tools/examples/add-example-boilerplate add", "boilerplate:remove": "node ./tools/examples/add-example-boilerplate remove", "generate-plunkers": "node ./tools/plunker-builder/generatePlunkers" diff --git a/aio/scripts/deploy-staging.sh b/aio/scripts/deploy-staging.sh new file mode 100644 index 0000000000..a33ee0f09b --- /dev/null +++ b/aio/scripts/deploy-staging.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +# WARNING: FIREBASE_TOKEN should NOT be printed. +set +x -eu -o pipefail + + +FIREBASE_PROJECT_ID=aio-staging + +cd "`dirname $0`/.." + +# Build the app +yarn build + +# Deploy to staging +firebase use "$FIREBASE_PROJECT_ID" --token "$FIREBASE_TOKEN" +firebase deploy --message "Commit: $TRAVIS_COMMIT" --non-interactive --token "$FIREBASE_TOKEN" + +cd -