Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit 21feb5d

Browse files
author
jmusselwhite
committed
$USER was not defined in the containers in Jenkins so I'm removing the usage of it. Its better without it anyway
1 parent 3c383dc commit 21feb5d

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff 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
1919
linting: 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
2527
create:
26-
@source ./create.sh demo-postgres user user
28+
@source ./create.sh $(SQLNAME) user user
2729

2830
.PHONY: expose
2931
expose:
3032
@source ./scripts/expose.sh
3133

3234
.PHONY: validate
3335
validate:
34-
@source ./validate.sh demo-postgres
36+
@source ./validate.sh $(SQLNAME)
3537

3638
.PHONY: teardown
3739
teardown:
38-
@source ./teardown.sh demo-postgres
40+
@source ./teardown.sh $(SQLNAME)
3941

4042
.PHONY: check_shell
4143
check_shell:

scripts/cluster.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
set -o errexit
2121

22-
CLUSTER_NAME=$USER-poc-cluster
22+
CLUSTER_NAME=postgres-demo-cluster
2323
PROJECT=$(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
4141
gcloud container clusters get-credentials "$CLUSTER_NAME" --zone "$CLUSTER_ZONE"

scripts/delete_resources.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
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
2323
PROJECT=$(gcloud config get-value core/project)
2424
CLUSTER_ZONE=$(gcloud config get-value compute/zone)
2525

2626
FULL_SA_NAME=$SA_NAME@$PROJECT.iam.gserviceaccount.com
2727
FULL_NODE_SA_NAME=$NODE_SA_NAME@$PROJECT.iam.gserviceaccount.com
2828

2929
gcloud container clusters delete \
30-
"$USER"-poc-cluster --zone "$CLUSTER_ZONE" --quiet
30+
postgres-demo-cluster --zone "$CLUSTER_ZONE" --quiet
3131

3232
gcloud projects remove-iam-policy-binding "$PROJECT" \
3333
--member serviceAccount:"$FULL_SA_NAME" \

scripts/service_account.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
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
2525
PROJECT=$(gcloud config get-value core/project)
2626

2727
if [ -z "$PROJECT" ]; then

validate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
ROOT=$(dirname "${BASH_SOURCE[0]}")
2121

22-
CLUSTER_NAME=$USER-poc-cluster
22+
CLUSTER_NAME=postgres-demo-cluster
2323

2424
help() {
2525
echo "./validate.sh INSTANCE_NAME"

0 commit comments

Comments
 (0)