Last active
May 31, 2017 05:15
-
-
Save stewartpark/21847ef93227241c3785f90f6795bec2 to your computer and use it in GitHub Desktop.
setup-gcloud.sh
This file contains 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 | |
# This script is to set up Google Cloud in CircleCI | |
# Author: Stewart Park <[email protected]> | |
# | |
# Usage: | |
# (set up GCLOUD_SERVICE_KEY as a base64-encoded json credentials file, GCLOUD_PROJECT_ID as your project ID) | |
# curl -L https://goo.gl/6pDHc6 | bash | |
sudo -E env "PATH=$PATH" gcloud --quiet components update | |
sudo chmod 757 /home/ubuntu/.config/gcloud/logs -R | |
echo $GCLOUD_SERVICE_KEY | base64 --decode --ignore-garbage > ${HOME}/gcloud-service-key.json | |
gcloud --quiet components update | |
gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json | |
gcloud config set project $GCLOUD_PROJECT_ID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment