Skip to content

Commit 333ec80

Browse files
devversionmmalerba
authored andcommitted
build: fix screenshot tool deployment (#6337)
* Currently the screenshot tool application is not built in the deploy script. This causes Firebase to throw an error because the target directory does not exist.
1 parent 7bc648b commit 333ec80

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

scripts/ci/travis-deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if [[ "${DEPLOY_MODE}" == "docs-content" ]]; then
3030
fi
3131

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

3636
if [[ "${DEPLOY_MODE}" == "dashboard" ]]; then

scripts/deploy/deploy-screenshot-functions.sh renamed to scripts/deploy/deploy-screenshot-tool.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# The script should immediately exit if any command in the script fails.
44
set -e
55

6-
# This script deploys the Cloud Functions of the screenshot tool to Firebase.
7-
# Before deploying, the script installs all dependencies of the functions.
6+
# This script deploys the Screenshot Tool and their Cloud Functions to Firebase.
7+
# Before deploying, the script installs all dependencies of the functions and builds the app.
88

99
# Go to the project root directory
1010
cd $(dirname ${0})/../..
@@ -24,10 +24,18 @@ firebaseBin=$(npm bin)/firebase
2424
# Go to the screenshot-test folder because otherwise Firebase tries to deploy the wrong project.
2525
cd ${screenshotToolFolder}
2626

27-
# Install node modules for the screenshot functions. Firebase CLI needs to execute the functions
27+
# Install node_modules for the application and afterwards build the application in production.
28+
(npm install; $(npm bin)/ng build --aot -prod) &
29+
30+
# Install node modules for screenshot-tool functions. Firebase CLI needs to execute the functions
2831
# to collect all function names before it can deploy them.
29-
(cd functions; npm install)
32+
(cd functions; npm install) &
33+
34+
# The screenshot application is being built asynchronously. Also the dependencies for the
35+
# Cloud Functions are built asynchronously. This means that the script needs to wait for all
36+
# async tasks to finish before proceeding.
37+
wait
3038

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

0 commit comments

Comments
 (0)