This repository was archived by the owner on Nov 30, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +13
-11
lines changed
Expand file tree Collapse file tree 5 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -18,24 +18,26 @@ SHELL := /usr/bin/env bash
1818# All is the first target in the file so it will get picked up when you just run 'make' on its own
1919linting : check_shell check_python check_golang check_terraform check_docker check_base_files check_headers check_trailing_whitespace
2020
21+ SQLNAME := demo-postgres-3
22+
2123# The .PHONY directive tells make that this isn't a real target and so
2224# the presence of a file named 'check_shell' won't cause this target to stop
2325# working
2426.PHONY : create
2527create :
26- @source ./create.sh demo-postgres user user
28+ @source ./create.sh $( SQLNAME ) user user
2729
2830.PHONY : expose
2931expose :
3032 @source ./scripts/expose.sh
3133
3234.PHONY : validate
3335validate :
34- @source ./validate.sh demo-postgres
36+ @source ./validate.sh $( SQLNAME )
3537
3638.PHONY : teardown
3739teardown :
38- @source ./teardown.sh demo-postgres
40+ @source ./teardown.sh $( SQLNAME )
3941
4042.PHONY : check_shell
4143check_shell :
Original file line number Diff line number Diff line change 1919
2020set -o errexit
2121
22- CLUSTER_NAME=$USER -poc -cluster
22+ CLUSTER_NAME=postgres-demo -cluster
2323PROJECT=$( gcloud config get-value core/project)
2424
2525# This line is just to eliminate a warning that GKE behavior will change in the
@@ -35,7 +35,7 @@ gcloud container clusters create "$CLUSTER_NAME" \
3535--num-nodes 1 \
3636--enable-autorepair \
3737--zone " $CLUSTER_ZONE " \
38- --service-account=" $USER " -poc -node-sa@" $PROJECT " .iam.gserviceaccount.com \
38+ --service-account=" postgres-demo -node-sa@$PROJECT " .iam.gserviceaccount.com \
3939
4040# Setting up .kube/config. This happens normally if you don't use --async
4141gcloud container clusters get-credentials " $CLUSTER_NAME " --zone " $CLUSTER_ZONE "
Original file line number Diff line number Diff line change 1818# Cloud SQL instance takes a long time so deleting it is a separate step
1919# that includes a prompt in another script
2020
21- SA_NAME=$USER -poc -sa
22- NODE_SA_NAME=$USER -poc -node-sa
21+ SA_NAME=postgres-demo -sa
22+ NODE_SA_NAME=postgres-demo -node-sa
2323PROJECT=$( gcloud config get-value core/project)
2424CLUSTER_ZONE=$( gcloud config get-value compute/zone)
2525
2626FULL_SA_NAME=$SA_NAME @$PROJECT .iam.gserviceaccount.com
2727FULL_NODE_SA_NAME=$NODE_SA_NAME @$PROJECT .iam.gserviceaccount.com
2828
2929gcloud container clusters delete \
30- " $USER " -poc -cluster --zone " $CLUSTER_ZONE " --quiet
30+ postgres-demo -cluster --zone " $CLUSTER_ZONE " --quiet
3131
3232gcloud projects remove-iam-policy-binding " $PROJECT " \
3333--member serviceAccount:" $FULL_SA_NAME " \
Original file line number Diff line number Diff line change 2020# The second is for the GKE nodes and it gets the minimal permissions needed
2121# for logging and monitoring as recommended by the GKE documentation
2222
23- SA_NAME=$USER -poc -sa
24- NODE_SA_NAME=$USER -poc -node-sa
23+ SA_NAME=postgres-demo -sa
24+ NODE_SA_NAME=postgres-demo -node-sa
2525PROJECT=$( gcloud config get-value core/project)
2626
2727if [ -z " $PROJECT " ]; then
Original file line number Diff line number Diff line change 1919
2020ROOT=$( dirname " ${BASH_SOURCE[0]} " )
2121
22- CLUSTER_NAME=$USER -poc -cluster
22+ CLUSTER_NAME=postgres-demo -cluster
2323
2424help () {
2525 echo " ./validate.sh INSTANCE_NAME"
You can’t perform that action at this time.
0 commit comments