summaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorZach Koopmans <zkoopmans@google.com>2020-04-01 17:39:12 -0700
committergVisor bot <gvisor-bot@google.com>2020-04-01 17:40:19 -0700
commit37025990d6ed1f1160937c640855070d9a559cb0 (patch)
treeb413cd68446d046216448c1a46cc3f1413bcf2ed /scripts
parent1561ae3037e5a3efdd26320f229fc4c602258dba (diff)
Add "/snap/bin" to PATH.
"gcloud" may be installed as a snap, under "/snap/bin". Make sure this is in our PATH so that we can use gcloud. PiperOrigin-RevId: 304297180
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/benchmark.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/benchmark.sh b/scripts/benchmark.sh
index 3fd80fc2e..e2d688710 100755
--- a/scripts/benchmark.sh
+++ b/scripts/benchmark.sh
@@ -16,12 +16,19 @@
source $(dirname $0)/common.sh
+# gcloud may be installed as a "snap". If it is, include it in PATH.
+declare -r snap="/snap/bin"
+if [[ -d "-d ${snap}" ]]; then
+ export PATH="${PATH}:${snap}"
+fi
+
+# Make sure we can call gcloud and exit if not.
+which gcloud
+
# Exporting for subprocesses as GCP APIs and tools check this environmental
# variable for authentication.
export GOOGLE_APPLICATION_CREDENTIALS="${KOKORO_KEYSTORE_DIR}/${GCLOUD_CREDENTIALS}"
-which gcloud
-
gcloud auth activate-service-account \
--key-file "${GOOGLE_APPLICATION_CREDENTIALS}"