Skip to content

build: fix screenshot tool deployment #6337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/ci/travis-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if [[ "${DEPLOY_MODE}" == "docs-content" ]]; then
fi

if [[ "${DEPLOY_MODE}" == "screenshot-tool" ]]; then
./scripts/deploy/deploy-screenshot-functions.sh
./scripts/deploy/deploy-screenshot-tool.sh
fi

if [[ "${DEPLOY_MODE}" == "dashboard" ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# 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.
# This script deploys the Screenshot Tool and their Cloud Functions to Firebase.
# Before deploying, the script installs all dependencies of the functions and builds the app.

# Go to the project root directory
cd $(dirname ${0})/../..
Expand All @@ -24,10 +24,18 @@ 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
# Install node_modules for the application and afterwards build the application in production.
(npm install; $(npm bin)/ng build --aot -prod) &

# Install node modules for screenshot-tool functions. Firebase CLI needs to execute the functions
# to collect all function names before it can deploy them.
(cd functions; npm install)
(cd functions; npm install) &

# The screenshot application is being built asynchronously. Also the dependencies for the
# Cloud Functions are built asynchronously. This means that the script needs to wait for all
# async tasks to finish before proceeding.
wait

# Deploy the screenshot application and functions to Firebase
# Deploy the screenshot application and their functions to Firebase
${firebaseBin} deploy --token ${MATERIAL2_SCREENSHOT_FIREBASE_DEPLOY_TOKEN} --non-interactive \
--project material2-screenshots