https://github.com/rlancer/gcloud-configuration-auto-switcher
A small script for automatically switching between gcloud configurations
https://github.com/rlancer/gcloud-configuration-auto-switcher
Last synced: 3 months ago
JSON representation
A small script for automatically switching between gcloud configurations
- Host: GitHub
- URL: https://github.com/rlancer/gcloud-configuration-auto-switcher
- Owner: rlancer
- Created: 2018-06-15T18:10:10.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-15T18:31:31.000Z (almost 8 years ago)
- Last Synced: 2025-09-02T15:39:35.866Z (9 months ago)
- Size: 0 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
```bash
# 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
```