build(aio): add staging environment

You can now specify what environment you are building
by add it to the `yarn build` command. For example:

```
yarn build -- --env=stage
```

Moreover the `deploy-to-firebase.sh` script will automatically apply the
appropriate environment.
This commit is contained in:
Peter Bacon Darwin
2017-06-12 23:51:39 +01:00
committed by Pete Bacon Darwin
parent 541c9a94bf
commit 052331fabc
5 changed files with 13 additions and 2 deletions

View File

@ -8,11 +8,13 @@ readonly deployEnv=$1
case $deployEnv in
staging)
readonly buildEnv=stage
readonly projectId=aio-staging
readonly deployedUrl=https://$projectId.firebaseapp.com/
readonly firebaseToken=$FIREBASE_TOKEN
;;
production)
readonly buildEnv=prod
readonly projectId=angular-io
readonly deployedUrl=https://angular.io/
readonly firebaseToken=$FIREBASE_TOKEN
@ -27,7 +29,7 @@ esac
cd "`dirname $0`/.."
# Build the app
yarn build
yarn build -- --env=$buildEnv
# Deploy to Firebase
firebase use "$projectId" --token "$firebaseToken"