diff --git a/scripts/deploy/deploy-dashboard-functions.sh b/scripts/deploy/deploy-dashboard-functions.sh deleted file mode 100755 index b5948c5bdc5..00000000000 --- a/scripts/deploy/deploy-dashboard-functions.sh +++ /dev/null @@ -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 diff --git a/scripts/deploy/deploy-dashboard.sh b/scripts/deploy/deploy-dashboard.sh new file mode 100755 index 00000000000..4c32cd7910f --- /dev/null +++ b/scripts/deploy/deploy-dashboard.sh @@ -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 diff --git a/tools/dashboard/.angular-cli.json b/tools/dashboard/.angular-cli.json new file mode 100644 index 00000000000..fbf7a67a925 --- /dev/null +++ b/tools/dashboard/.angular-cli.json @@ -0,0 +1,37 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "project": { + "name": "material2-board" + }, + "apps": [ + { + "root": "src", + "outDir": "./dist", + "assets": [ + "assets", + "favicon.ico" + ], + "index": "index.html", + "main": "main.ts", + "polyfills": "polyfills.ts", + "tsconfig": "tsconfig.json", + "prefix": "app", + "styles": [ + "styles.css" + ], + "scripts": [], + "environmentSource": "environments/environment.ts", + "environments": { + "dev": "environments/environment.ts", + "prod": "environments/environment.prod.ts" + } + } + ], + "e2e": {}, + "lint": [], + "test": {}, + "defaults": { + "styleExt": "css", + "component": {} + } +} diff --git a/tools/dashboard/.gitignore b/tools/dashboard/.gitignore new file mode 100644 index 00000000000..b672e5b1b42 --- /dev/null +++ b/tools/dashboard/.gitignore @@ -0,0 +1,4 @@ +# Sub Gitignore file for the Dashboard project. +dist/ +node_modules/ +package-lock.json diff --git a/tools/dashboard/package.json b/tools/dashboard/package.json new file mode 100644 index 00000000000..2a17ada9f4f --- /dev/null +++ b/tools/dashboard/package.json @@ -0,0 +1,37 @@ +{ + "name": "material2-board", + "version": "0.0.0", + "license": "MIT", + "scripts": { + "ng": "ng", + "start": "ng serve", + "build": "ng build", + "build-production": "ng build --aot -prod" + }, + "private": true, + "dependencies": { + "@angular/animations": "^4.2.2", + "@angular/common": "^4.2.2", + "@angular/compiler": "^4.2.2", + "@angular/core": "^4.2.2", + "@angular/forms": "^4.2.2", + "@angular/http": "^4.2.2", + "@angular/platform-browser": "^4.2.2", + "@angular/platform-browser-dynamic": "^4.2.2", + "@angular/router": "^4.2.2", + "core-js": "^2.4.1", + "rxjs": "^5.1.0", + "zone.js": "^0.8.12" + }, + "devDependencies": { + "@angular/cli": "1.1.1", + "@angular/compiler-cli": "^4.2.2", + "@angular/language-service": "^4.2.2", + "@types/jasmine": "2.5.45", + "@types/node": "~6.0.60", + "firebase-tools": "^3.9.1", + "ts-node": "~3.0.4", + "tslint": "~5.3.2", + "typescript": "~2.3.3" + } +} diff --git a/tools/dashboard/src/app/dashboard-app.css b/tools/dashboard/src/app/dashboard-app.css new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tools/dashboard/src/app/dashboard-app.html b/tools/dashboard/src/app/dashboard-app.html new file mode 100644 index 00000000000..57453e92c56 --- /dev/null +++ b/tools/dashboard/src/app/dashboard-app.html @@ -0,0 +1 @@ +