From 9ea7dd5a4b2ed8dcab04c6fc71d44e2875d8688d Mon Sep 17 00:00:00 2001 From: James Davis Date: Sat, 11 Jan 2020 19:21:29 -0500 Subject: [PATCH] Select the first open billing account. --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 6021df8..7450c2e 100755 --- a/setup.sh +++ b/setup.sh @@ -38,7 +38,7 @@ gcloud projects create "${GOOGLE_PROJECT_ID}" gcloud config set project "${GOOGLE_PROJECT_ID}" # Enable billing and containers with the first billing account -BILLING_ACCOUNT=$(gcloud beta billing accounts list --format json | jq -r '.[0].name') +BILLING_ACCOUNT=$(gcloud beta billing accounts list --format json | jq -r 'map(select(.open == true)) | .[0].name') gcloud beta billing projects link "${GOOGLE_PROJECT_ID}" --billing-account "${BILLING_ACCOUNT#billingAccounts/}" gcloud services enable container.googleapis.com --project "${GOOGLE_PROJECT_ID}"