build: deploy screenshot functions (#4698)

* build: deploy screenshot functions

* Deploys the screenshot functions for push builds
* Runs deploying & publishing in parallel

* Fix comment about parallel
This commit is contained in:
Paul Gschwendtner
2017-05-22 23:58:32 +02:00
committed by tinayuangao
parent eecf8976d6
commit ecea23c684
5 changed files with 45 additions and 8 deletions
@@ -0,0 +1,17 @@
#!/bin/bash
# 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}
+7 -2
View File
@@ -12,6 +12,9 @@ cd $(dirname ${0})/../..
PACKAGES=(cdk material)
REPOSITORIES=(cdk-builds material2-builds)
# Command line arguments.
COMMAND_ARGS=${*}
# Function to publish artifacts of a package to Github.
# @param ${1} Name of the package
# @param ${2} Repository name of the package.
@@ -30,8 +33,10 @@ publishPackage() {
repoUrl="https://github.com/angular/${packageRepo}.git"
repoDir="tmp/${packageRepo}"
# Create a release of the current repository.
$(npm bin)/gulp ${packageName}:build-release:clean
if [[ ! ${COMMAND_ARGS} == *--no-build* ]]; then
# Create a release of the current repository.
$(npm bin)/gulp ${packageName}:build-release:clean
fi
# Prepare cloning the builds repository
rm -rf ${repoDir}
+4 -2
View File
@@ -11,8 +11,10 @@ repoPath="/tmp/material2-docs-content"
repoUrl="https://github.com/angular/material2-docs-content"
examplesSource="./dist/docs/examples"
$(npm bin)/gulp material-examples:build-release:clean
$(npm bin)/gulp docs
if [[ ! ${*} == *--no-build* ]]; then
$(npm bin)/gulp material-examples:build-release:clean
$(npm bin)/gulp docs
fi
# Get git meta info for commit
commitSha="$(git rev-parse --short HEAD)"