Skip to content

Instantly share code, notes, and snippets.

@qwertyfinger
Created March 27, 2019 02:57
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 qwertyfinger/32e6423cfebbe0478014cbe0cd9824fb to your computer and use it in GitHub Desktop.
Save qwertyfinger/32e6423cfebbe0478014cbe0cd9824fb to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ "$GCLOUD_SERVICE_KEY" = "" ]; then
echo "GCLOUD_SERVICE_KEY env variable is empty. Exiting."
exit 1
fi
# Export to secrets file
echo $GCLOUD_SERVICE_KEY | base64 -di > gcloud-service-key.json
# Set project ID
gcloud config set project $GOOGLE_PROJECT_ID
# Auth account
gcloud auth activate-service-account andrii-chubko-ftl@android-simple-boilerplate.iam.gserviceaccount.com --key-file gcloud-service-key.json
# Delete secret
rm gcloud-service-key.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment