diff --git a/.buildkite/scripts/bootstrap.sh b/.buildkite/scripts/bootstrap.sh index b7576dda72f24..b609eb6692c74 100755 --- a/.buildkite/scripts/bootstrap.sh +++ b/.buildkite/scripts/bootstrap.sh @@ -2,6 +2,8 @@ set -euo pipefail +gcloud config get-value core/account + source .buildkite/scripts/common/util.sh source .buildkite/scripts/common/setup_bazel.sh diff --git a/.buildkite/scripts/lifecycle/pre_command.sh b/.buildkite/scripts/lifecycle/pre_command.sh index 0ee9ec5a0d5f2..1acef85bba3e1 100755 --- a/.buildkite/scripts/lifecycle/pre_command.sh +++ b/.buildkite/scripts/lifecycle/pre_command.sh @@ -36,6 +36,18 @@ if [[ "$(curl -is metadata.google.internal || true)" ]]; then echo "" fi +# Check if we have gcloud, if yes, check which account, if not, check the config paths +if [[ -x "$(command -v gcloud)" ]]; then + gcloud config get-value core/account +else + echo "gcloud not found, checking config paths" + ls -la $HOME/.config/gcloud + ls -la $HOME/.config/gcloud/legacy_credentials + if [[ -f "$HOME/.config/gcloud/configurations/config_default" ]]; then + cat $HOME/.config/gcloud/configurations/config_default + fi +fi + echo '--- Job Environment Setup' # Set up a custom ES Snapshot Manifest if one has been specified for this build