Skip to content

Instantly share code, notes, and snippets.

@scjody
Created February 5, 2018 18:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save scjody/992a61892ebe157b18db33fc3fb874ad to your computer and use it in GitHub Desktop.
Save scjody/992a61892ebe157b18db33fc3fb874ad to your computer and use it in GitHub Desktop.
"gcloud config" wrapper to easily select the correct configuration
#!/bin/bash
if [[ -z "$1" ]]; then
gcloud config configurations list;
else
case "$1" in
# These clauses implement aliases for my most commonly used configurations.
# Change them to support your needs or remove them.
prod)
gcloud config configurations activate default
;;
test)
gcloud config configurations activate plotly-testing
;;
*)
gcloud config configurations activate "$1"
;;
esac;
fi
@scjody
Copy link
Author

scjody commented Feb 5, 2018

Put this in your path to make selecting configurations easier.

gc             # list configurations
gc prod        # switch to the "default" configuration (prod is an alias)
gc someconfig  # switch to the "someconfig" configuration

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