Skip to content

Just some misc Bash shell funcs to make life with the gcloud cli a little easier.

License

Notifications You must be signed in to change notification settings

gwinans/misc-gcp-shell-funcs

Repository files navigation

gcloud shell funcs

.. and other crap.

The repository contains useful Bash shell funcs for the gcloud cli, cloud-sql-proxy and misc helper funcs.

Content

Why?

Why not? I'm lazy.

All of these functions can be used directly if sourced.

Directory Structure:

|-- cloudsql_helper.sh       | Helper functions for CloudSQL
|-- cloudsql_proxy_helpe.sh  | Helper functions for the cloud_sql_proxy (1.37.0, no support for v2+)
|-- gcloud_helpers.sh        | Helper functions for the gcloud CLI
|-- generic_helpers.sh       | Generic bash/zsh helper functions, can be used directly if sourced.

Pre-Reqs

If you are on ... any Linux distro

Install the following:

If you are on a Mac

Install the following:

Execute the following:

brew install bash gnu-getopt coreutils gcloud 
brew link gnu-getopt
brew link coreutils
echo 'export PATH="/opt/homebrew/bin:/opt/homebrew/opt/gnu-getopt/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

Usage

source *.sh

All of these functions can be executed as shell funcs except for cloudsql_create_superuser.. unless you've also sourced generic_helpers.sh

get_secret my-project my-secret-name

These can - hopefully obviously - be used in shell scripts as well.

#!/usr/bin/env bash

for f in /path/to/the/files/*.sh; do source "${f}"; done

mypwd="$( get_secret my-project my-secret-name )"

echo "${mypwd}"

About

Just some misc Bash shell funcs to make life with the gcloud cli a little easier.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages