mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build: initial dashboard project (#5148)
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
#!/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
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script deploys the Dashboard App and their Cloud Functions to Firebase.
|
||||
# Before the script installs all dependencies and builds the dashboard app in production.
|
||||
|
||||
# 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 the dashboard and afterwards build the dashboard app in production.
|
||||
(npm install; $(npm bin)/ng build --aot -prod) &
|
||||
|
||||
# Install node modules for dashboard functions. Firebase CLI needs to execute the functions
|
||||
# to collect all function names before it can deploy them.
|
||||
(cd functions; npm install) &
|
||||
|
||||
# The dashboard and function dependencies are installed concurrently. Also the dashboard app is
|
||||
# build in production afterwards. Wait for all async tasks to finish before proceeding.
|
||||
wait
|
||||
|
||||
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 to Firebase. Based on the current configuration hosting and functions
|
||||
# will be deployed.
|
||||
$(npm bin)/firebase deploy --token ${MATERIAL2_BOARD_FIREBASE_DEPLOY_KEY} --project material2-board
|
||||
Reference in New Issue
Block a user