File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 44set -e
55
66function usage {
7- echo " Usage: $0 <project_id>"
7+ echo " Usage: $0 <project_id> [<token>] "
88 exit 1
99}
1010
11- # This script takes in one argument specifying a project_id
12- # Example usage (from root dir):
11+ # This script takes in one required argument specifying a project_id and an
12+ # optional arguement for a CI token that can be obtained by running
13+ # `firebase login:ci`
14+ # Example usage (from root dir) without token:
1315# ./integration_test/run_tests.sh chenky-test-proj
16+ # Example usage (from root dir) with token:
17+ # ./integration_test/run_tests.sh chenky-test-proj $TOKEN
1418if [[ $1 == " " ]]; then
1519 usage
1620fi
1721
22+ TOKEN=" "
23+ if [[ $2 != " " ]]; then
24+ TOKEN=$2
25+ fi
26+
1827PROJECT_ID=$1
1928
2029# Directory where this script lives.
@@ -63,7 +72,11 @@ function deploy {
6372 cd $DIR
6473 ./functions/node_modules/.bin/tsc -p functions/
6574 # Deploy functions, and security rules for database and Firestore. If the deploy fails, retry twice
66- for i in 1 2 3; do firebase deploy --project=$PROJECT_ID --only functions,database,firestore && break ; done
75+ if [[ $TOKEN == " " ]]; then
76+ for i in 1 2 3; do firebase deploy --project=$PROJECT_ID --only functions,database,firestore && break ; done
77+ else
78+ for i in 1 2 3; do firebase deploy --project=$PROJECT_ID --token=$TOKEN --only functions,database,firestore && break ; done
79+ fi
6780}
6881
6982function run_tests {
You can’t perform that action at this time.
0 commit comments