-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathenv-bigquery.sh
More file actions
executable file
·25 lines (18 loc) · 952 Bytes
/
env-bigquery.sh
File metadata and controls
executable file
·25 lines (18 loc) · 952 Bytes
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
#! /usr/bin/env bash
set -euo pipefail
item_data=$(op item get "driver: bigquery-cloud-sdk" --vault="Driver Development" --format=json)
CLOUD_SDK_TEST_SERVICE_ACCOUNT_JSON=$(echo ${item_data} | jq -r '.fields[] | select(.label == "SERVICE_ACCOUNT_JSON").value' | sed 's/"/\\"/g')
PROJECT_ID=$(echo ${item_data} | jq -r '.fields[] | select(.label == "PROJECT_ID").value')
function print-bigquery-vars() {
cat <<EOF
Java properties:
-Dmb.bigquery.cloud.sdk.test.service.account.json="${CLOUD_SDK_TEST_SERVICE_ACCOUNT_JSON}" -Dmb.bigquery.test.project.id=${PROJECT_ID}
Clojure pairs:
:mb-bigquery-cloud-sdk-test-service-account-json "${CLOUD_SDK_TEST_SERVICE_ACCOUNT_JSON}" :mb-bigquery-test-project-id "${PROJECT_ID}"
Bash variables:
MB_BIGQUERY_CLOUD_SDK_TEST_SERVICE_ACCOUNT_JSON="${CLOUD_SDK_TEST_SERVICE_ACCOUNT_JSON}" MB_BIGQUERY_TEST_PROJECT_ID=${PROJECT_ID}
EOF
}
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
print-bigquery-vars
fi