Last active
April 16, 2024 14:03
-
-
Save oofnikj/7a2fb1e6b20b397775d882ecd8980159 to your computer and use it in GitHub Desktop.
Download and install latest google-cloud-sdk on Alpine / Debian / Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
###### | |
# Tested with various flavors of Alpine, Ubuntu and Debian. CentOS / RedHat not supported (yet). | |
# Use: | |
# wget -qO- https://gist.githubusercontent.com/oofnikj/7a2fb1e6b20b397775d882ecd8980159/raw | sh | |
###### | |
SDK_DIR=/usr/local/lib | |
which apt && apt update && apt install -y wget jq python3 ca-certificates --no-install-recommends || true | |
which apk && apk update && apk add wget jq python3 ca-certificates || true | |
wget -qO- \ | |
"https://www.googleapis.com/storage/v1/b/cloud-sdk-release/o?prefix=google-cloud-sdk-2" \ | |
| jq -r '.items[].selfLink | select ( match ("linux-x86_64") )' \ | |
| tail -n1 \ | |
| wget -qO- $(awk '{print $1"?alt=media"}') | tar xzf - -C $SDK_DIR | |
/usr/local/lib/google-cloud-sdk/install.sh --quiet | |
echo "export PATH=$SDK_DIR/google-cloud-sdk/bin:$PATH" | tee -a /etc/profile.d/gcloud-sdk.sh | |
. /etc/profile | |
gcloud version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Had the same issue, you need to use python 3.9 or lower