Created
June 4, 2019 20:49
-
-
Save glickbot/561ca0c92dfd9b8225cdcd4db71e1b47 to your computer and use it in GitHub Desktop.
Simple unattended gcloud installer
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/bash | |
set -e | |
pushd $HOME > /dev/null | |
if ! which gcloud > /dev/null; then | |
arch="x86" | |
os="linux" | |
if uname -a | grep -i 'x86_64' > /dev/null; then | |
arch="x86_64" | |
fi | |
if uname -a | grep -i 'darwin' > /dev/null; then | |
os="darwin" | |
fi | |
curl -s $(curl https://cloud.google.com/sdk/docs/downloads-versioned-archives -s -o -|grep -Eo 'https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-([0-9\-\.]*)-'$os'-'$arch'.tar.gz')|tar -xz | |
./google-cloud-sdk/install.sh --usage-reporting false -q --command-completion true --path-update true | |
fi | |
popd > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment