forked from microblink/microblink-scan-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·42 lines (34 loc) · 1.01 KB
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
if [ "$1" == "production" ]; then
ENVIRONMENT="production"
FIREBASE_PROJECT="microblink-api-exchanger"
else
ENVIRONMENT="staging"
FIREBASE_PROJECT="microblink-api-exchanger-dev"
fi
echo "Config variables"
echo "ENVIRONMENT = $ENVIRONMENT"
echo "FIREBASE_PROJECT = $FIREBASE_PROJECT"
echo ""
firebase use $FIREBASE_PROJECT
echo "SKIP_HOSTING=$SKIP_HOSTING"
echo "SKIP_FUNCTIONS=$SKIP_FUNCTIONS"
if [ "$SKIP_HOSTING" == "true" ] ; then
echo "Skip deploy to Firebase hosting"
else
if [ "$ENVIRONMENT" == "production" ]; then
echo "Production build environment.prod"
ng build public-scan-client --prod
else
echo "Staging build environment.staging"
ng build public-scan-client --configuration staging
fi
echo "Deploy to Firebase hosting..."
firebase deploy --only hosting
fi
if [ "$SKIP_FUNCTIONS" == "true" ] ; then
echo "Skip deploy of Firebase functions"
else
echo "Deploy of Firebase functions..."
firebase deploy --only functions
fi