Files
angular__angular/scripts/deploy/deploy-screenshot-functions.sh
T
Paul Gschwendtner d859d34739 build: better error reporting of bash scripts (#5397)
Currently whenever something fails in the deploy script it will likely not cause the CI to show the failure. This is because Bash by default doesn't exit the process with the proper error code.
2017-06-29 10:32:00 -07:00

21 lines
695 B
Bash
Executable File

#!/bin/bash
# The script should immediately exit if any command in the script fails.
set -e
# Go to the project root directory
cd $(dirname ${0})/../..
# Install node modules for screenshot functions. Firebase CLI needs to execute the functions
# before it can collect all functions and deploy them.
(cd tools/screenshot-test/functions; npm install)
if [ -z ${MATERIAL2_SCREENSHOT_ACCESS_TOKEN} ]; then
echo "Error: No access token for firebase specified." \
"Please set the environment variable 'MATERIAL2_SCREENSHOT_ACCESS_TOKEN'."
exit 1
fi
# Deploy the screenshot functions to Firebase
$(npm bin)/firebase deploy --only functions --token ${MATERIAL2_SCREENSHOT_ACCESS_TOKEN}