3
3
# The script should immediately exit if any command in the script fails.
4
4
set -e
5
5
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 .
8
8
9
9
# Go to the project root directory
10
10
cd $( dirname ${0} ) /../..
@@ -24,10 +24,18 @@ firebaseBin=$(npm bin)/firebase
24
24
# Go to the screenshot-test folder because otherwise Firebase tries to deploy the wrong project.
25
25
cd ${screenshotToolFolder}
26
26
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
28
31
# 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
30
38
31
- # Deploy the screenshot application and functions to Firebase
39
+ # Deploy the screenshot application and their functions to Firebase
32
40
${firebaseBin} deploy --token ${MATERIAL2_SCREENSHOT_FIREBASE_DEPLOY_TOKEN} --non-interactive \
33
41
--project material2-screenshots
0 commit comments