Skip to content

Instantly share code, notes, and snippets.

@masuidrive
Last active October 7, 2018 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masuidrive/676c571d81f02d569eaa29921382f0a0 to your computer and use it in GitHub Desktop.
Save masuidrive/676c571d81f02d569eaa29921382f0a0 to your computer and use it in GitHub Desktop.
Install gcloud cli to CODER.com
# install for gcloud cli
# https://docs.coder.com/docs/tech-faqs
apt install python2.7 python-pip -y
# install yarn for node
curl -o- -L https://yarnpkg.com/install.sh | sh
# install gcloud
curl -o- -L https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-219.0.1-linux-x86_64.tar.gz | tar xfz - -C /usr/local
# sometime python2.7 was automatically overrided to latest python. Probablly It's CODER's bug.
# So, Take it to safe folder.
cp /usr/bin/python2.7 /usr/local/google-cloud-sdk/bin/
echo "" >> ~/.bashrc
echo "export PATH=/usr/local/google-cloud-sdk/bin:\$PATH" >> ~/.bashrc
echo "export CLOUDSDK_PYTHON=/usr/local/google-cloud-sdk/bin/python2.7" >> ~/.bashrc
echo "export CLOUDSDK_CONFIG=.config/gcloud" >> ~/.bashrc
@masuidrive
Copy link
Author

CODERのProjectのTerminalで下記を実行してください。
gcloudコマンドを実行した際に表示されるURLをコピーすると、改行コードが入ってしまうのでペーストした後に取り除いてください。

curl -o- -L https://gist.githubusercontent.com/masuidrive/676c571d81f02d569eaa29921382f0a0/raw/3b8631ee4642f29c22e616452b409ae7dc300fac/install.sh | sh
. ~/.bashrc
gcloud init

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment