mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
298bc031da
The deploy script for the screenshot-test tool right now references a incorrect directory. This means that the screenshot-test tool can't be uploaded for push builds right now.
34 lines
1.2 KiB
Bash
Executable File
34 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# The script should immediately exit if any command in the script fails.
|
|
set -e
|
|
|
|
# This script deploys the Cloud Functions of the screenshot tool to Firebase.
|
|
# Before deploying, the script installs all dependencies of the functions.
|
|
|
|
# Go to the project root directory
|
|
cd $(dirname ${0})/../..
|
|
|
|
if [ -z ${MATERIAL2_SCREENSHOT_FIREBASE_DEPLOY_TOKEN} ]; then
|
|
echo "Error: No access token for firebase specified." \
|
|
"Please set the environment variable 'MATERIAL2_SCREENSHOT_FIREBASE_DEPLOY_TOKEN'."
|
|
exit 1
|
|
fi
|
|
|
|
# Path to the screenshot tool in the project.
|
|
screenshotToolFolder="tools/screenshot-test"
|
|
|
|
# Path to the firebase binary of the root package.json
|
|
firebaseBin=$(npm bin)/firebase
|
|
|
|
# Go to the screenshot-test folder because otherwise Firebase tries to deploy the wrong project.
|
|
cd ${screenshotToolFolder}
|
|
|
|
# Install node modules for the screenshot functions. Firebase CLI needs to execute the functions
|
|
# to collect all function names before it can deploy them.
|
|
(cd functions; npm install)
|
|
|
|
# Deploy the screenshot functions to Firebase
|
|
${firebaseBin} deploy --only functions --token ${MATERIAL2_SCREENSHOT_FIREBASE_DEPLOY_TOKEN} \
|
|
--non-interactive --project material2-screenshots
|