Skip to content

Commit

Permalink
Merge pull request #862 from cheftako/master
Browse files Browse the repository at this point in the history
Skipping problematic reinstall of gcloud if setup.
  • Loading branch information
cheftako authored Sep 27, 2023
2 parents 7d32eea + 5db9d79 commit d5be2b6
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions scripts/environment-setup/gcp-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,20 @@ if [[ ! $(gcloud beta container clusters list | grep ${CLUSTER_NAME}) ]]; then
--workload-pool=${PROJECT_ID}.svc.id.goog
fi

echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" \
| sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
GCLOUD_PKG="google-cloud-sdk-gke-gcloud-auth-plugin"
if apt list $GCLOUD_PKG --installed | grep $GCLOUD_PKG; then
printf "GCloud already installed, skipping install"
else
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" \
| sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key \
--keyring /usr/share/keyrings/cloud.google.gpg add -
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key \
--keyring /usr/share/keyrings/cloud.google.gpg add -

sudo apt-get update && sudo apt-get install google-cloud-cli
sudo apt-get update && sudo apt-get install google-cloud-cli

sudo apt-get install google-cloud-sdk-gke-gcloud-auth-plugin
sudo apt-get install google-cloud-sdk-gke-gcloud-auth-plugin
fi

# Configure kubectl to communicate with the cluster.
gcloud container clusters get-credentials ${CLUSTER_NAME}
Expand Down

0 comments on commit d5be2b6

Please sign in to comment.