Skip to content

Instantly share code, notes, and snippets.

@scjody
Created Feb 5, 2018
Embed
What would you like to do?
"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