Last active
October 3, 2020 04:14
-
-
Save him229/523ae598ebd84bc475159ebab63fb4b1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
if [[ -z "$CLOUDSQL_SERVICE_ACCOUNT" ]]; then | |
echo "Must provide CLOUDSQL_SERVICE_ACCOUNT secret." 1>&2 | |
exit 1 | |
fi | |
mkdir gcloud | |
cd gcloud | |
curl https://sdk.cloud.google.com > install.sh | |
bash install.sh --disable-prompts > /dev/null 2>&1 | |
source /root/google-cloud-sdk/completion.bash.inc | |
source /root/google-cloud-sdk/path.bash.inc | |
echo "${CLOUDSQL_SERVICE_ACCOUNT}" | base64 -d > ./cred.json | |
wget https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 -O cloud_sql_proxy | |
chmod +x cloud_sql_proxy | |
./cloud_sql_proxy -instances=himank-jay:us-central1:reploy-sql=tcp:3306 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment