mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-09-18 22:14:22 +00:00
improve how scripts check for gcloud auth
This commit is contained in:
@@ -23,11 +23,10 @@ if ! command -v gcloud &> /dev/null; then
|
||||
echo "Please install the gcloud CLI"
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z "$(gcloud config list account --format "value(core.account)")" ]]; then
|
||||
echo "Please run \`gcloud auth login\`"
|
||||
if ! gcloud auth print-access-token &>/dev/null; then
|
||||
echo "Please run \`gcloud auth login\` and try again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z "${PINNIPED_GCP_PROJECT:-}" ]]; then
|
||||
echo "PINNIPED_GCP_PROJECT env var must be set"
|
||||
exit 1
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ function set_pipeline() {
|
||||
"$ROOT_DIR"/hack/setup-fly.sh
|
||||
|
||||
# Ensure that the user is authenticated with gcloud.
|
||||
if [[ -z "$(gcloud config list account --format "value(core.account)")" ]]; then
|
||||
if ! gcloud auth print-access-token &>/dev/null; then
|
||||
echo "Please run \`gcloud auth login\` and try again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
# To be run before local integration tests.
|
||||
# From the pinniped repo:
|
||||
# hack/prepare-for-integration-tests.sh --get-active-directory-vars "../pinniped-ci-branch/hack/get-aws-ad-env-vars.sh"
|
||||
if [[ -z "$(gcloud config list account --format "value(core.account)")" ]]; then
|
||||
echo "Please run \`gcloud auth login\`"
|
||||
if ! gcloud auth print-access-token &>/dev/null; then
|
||||
echo "Please run \`gcloud auth login\` and try again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
# To be run before local integration tests.
|
||||
# From the pinniped repo:
|
||||
# hack/prepare-for-integration-tests.sh --get-github-vars "../pinniped-ci-branch/hack/get-github-env-vars.sh"
|
||||
if [[ -z "$(gcloud config list account --format "value(core.account)")" ]]; then
|
||||
echo "Please run \`gcloud auth login\`"
|
||||
if ! gcloud auth print-access-token &>/dev/null; then
|
||||
echo "Please run \`gcloud auth login\` and try again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user