Files
angular__angular/scripts/deploy/deploy-screenshot-functions.sh
T
Paul Gschwendtner 298bc031da ci: incorrect path to screenshot-test tool (#6275)
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.
2017-08-04 14:03:08 -07:00

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