Skip to content

A small script for automatically switching between gcloud configurations

Notifications You must be signed in to change notification settings

rlancer/GCloud-Configuration-Auto-Switcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

gcloud Configuration Auto Switcher

Juggling many gcloud configurations at a time can be problematic. This recently happend when I deployed the wrong code to the wrong configuration, taking a service runing for a city offline for a few minutes.

Solution

Create a .gcloudrc file with the name of your configuration

Example .gcloudrc

my-config-1

Then add this script to your ~/.zshrc

# gcloud config auto switcher

gcloud-config(){
  if [ -e  .gcloudrc ]
  then
    local config=`cat .gcloudrc`
    echo "Activating gcloud configuration $config"
    gcloud config configurations activate $config
  fi

}

gcloud-config

About

A small script for automatically switching between gcloud configurations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published