-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathrun-deployed-gcp-kms-tests.sh
32 lines (24 loc) · 1.32 KB
/
run-deployed-gcp-kms-tests.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
#! /usr/bin/env bash
source "${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/secrets-export.sh"
source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh
# Assert required environment variables are present without printing them
if [ -z ${GCPKMS_GCLOUD+omitted} ]; then echo "GCPKMS_GCLOUD is unset" && exit 1; fi
if [ -z ${GCPKMS_PROJECT+omitted} ]; then echo "GCPKMS_PROJECT is unset" && exit 1; fi
if [ -z ${GCPKMS_ZONE+omitted} ]; then echo "GCPKMS_ZONE is unset" && exit 1; fi
if [ -z ${GCPKMS_INSTANCENAME+omitted} ]; then echo "GCPKMS_INSTANCENAME is unset" && exit 1; fi
set -o errexit
export GCPKMS_SRC=node-driver-source.tgz
export GCPKMS_DST=$GCPKMS_INSTANCENAME:
# Box up the entire driver and it's node_modules
echo "compressing node driver source ... begin"
tar -czf $GCPKMS_SRC src $DRIVERS_TOOLS
echo "compressing node driver source ... end"
echo "copying node driver tar ... begin"
"${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/copy-file.sh"
echo "copying node driver tar ... end"
echo "decompressing node driver tar on gcp ... begin"
export GCPKMS_CMD="tar -xzf $GCPKMS_SRC"
"${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/run-command.sh"
echo "decompressing node driver tar on gcp ... end"
export GCPKMS_CMD="env EXPECTED_GCPKMS_OUTCOME=success bash src/.evergreen/run-gcp-kms-tests.sh"
bash ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms/run-command.sh