Skip to content

Commit 89cb654

Browse files
ci: prepend kokoro root directory to the path to service-acct.json (#879)
1 parent 0517ebd commit 89cb654

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.kokoro/run_samples_resource_cleanup.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ source ${scriptDir}/common.sh
3232
source ${KOKORO_GFILE_DIR}/secret_manager/java-bigquery-samples-secrets
3333
echo "********** Successfully Set All Environment Variables **********"
3434

35+
# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it
36+
if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then
37+
export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS})
38+
fi
39+
3540
# Activate service account
3641
gcloud auth activate-service-account \
3742
--key-file="$GOOGLE_APPLICATION_CREDENTIALS" \

0 commit comments

Comments
 (0)