Files
angular__angular/scripts/deploy/deploy-dashboard-functions.sh
T
Paul Gschwendtner 7af93bc5e3 build: switch to new dashboard firebase instance (#4954)
* Switches to a new Firebase instance for the Dashboard.
2017-06-05 11:13:05 -07:00

25 lines
876 B
Bash
Executable File

#!/bin/bash
# Go to the project root directory
cd $(dirname ${0})/../..
# Paths to the dashboard and functions directories.
dashboardFolder=tools/dashboard
# Go to the dashboard folder because otherwise the Firebase CLI tries to deploy the wrong project.
cd ${dashboardFolder}
# Install node modules for dashboard functions. Firebase CLI needs to execute the functions
# before it can collect all functions and deploy them.
(cd functions; npm install)
if [ -z ${MATERIAL2_BOARD_FIREBASE_DEPLOY_KEY} ]; then
echo "Error: No access token for firebase specified." \
"Please set the environment variable 'MATERIAL2_DASHBOARD_ACCESS_TOKEN'."
exit 1
fi
# Deploy the dashboard functions to Firebase. For now only the functions will be deployed.
$(npm bin)/firebase deploy \
--only functions --token ${MATERIAL2_BOARD_FIREBASE_DEPLOY_KEY} --project material2-board