Created
April 8, 2020 15:41
-
-
Save micimize/d310d0458b58951efb3cdedcf690b39d to your computer and use it in GitHub Desktop.
snipped I might later use as part of an idempotent google cloud deployment script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
description=$(gcloud sql instances describe $DB 2>&1) | |
if [ $? -ne 0 ] | |
then | |
if [[ $description == *HTTPError* ]] | |
then | |
gcloud sql instances create $ \ | |
--database-version=POSTGRES_12 \ | |
--cpu=1 --memory=614MB \ | |
--region=us-central1 | |
fi | |
else | |
echo "Error, could not describe db: \n$description" | |
exit 1 | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment