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

Commit 8d536f8

Browse files
authored
Merge pull request #11 from pydevops/dev
upgrade jenkins-k8s-node to 1.1.0
2 parents 3cf0dee + a164be5 commit 8d536f8

File tree

6 files changed

+18
-13
lines changed

6 files changed

+18
-13
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Files for Demo
22
credentials.json
3-
instanceName
3+
.instance
44

55
# OSX leaves these everywhere on SMB shares
66
._*

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ metadata:
3333
spec:
3434
containers:
3535
- name: k8s-node
36-
image: gcr.io/pso-helmsman-cicd/jenkins-k8s-node:1.0.1
36+
image: gcr.io/pso-helmsman-cicd/jenkins-k8s-node:1.2.0
3737
imagePullPolicy: Always
3838
command:
3939
- cat

Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,24 @@ 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-8
22-
2321
# The .PHONY directive tells make that this isn't a real target and so
2422
# the presence of a file named 'check_shell' won't cause this target to stop
2523
# working
2624
.PHONY: create
2725
create:
28-
@source ./create.sh $(SQLNAME) user user
26+
@source ./create.sh user user
2927

3028
.PHONY: expose
3129
expose:
3230
@source ./scripts/expose.sh
3331

3432
.PHONY: validate
3533
validate:
36-
@source ./validate.sh $(SQLNAME)
34+
@source ./validate.sh
3735

3836
.PHONY: teardown
3937
teardown:
40-
@source ./teardown.sh $(SQLNAME)
38+
@source ./teardown.sh
4139

4240
.PHONY: check_shell
4341
check_shell:

create.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,28 @@
1919
# some accompanying service accounts
2020

2121
help() {
22-
echo "./create.sh INSTANCE_NAME POSTGRES_USERNAME PGADMIN_USERNAME"
22+
echo "./create.sh POSTGRES_USERNAME PGADMIN_USERNAME"
2323
echo "Passwords will be entered via prompts"
2424
}
2525

26-
export INSTANCE_NAME=$1
26+
ROOT=$(dirname "${BASH_SOURCE[0]}")
27+
28+
RANDOM_SUFFIX=$(tr -dc 'a-z0-9' </dev/urandom | fold -w 6 | head -n 1)
29+
export INSTANCE_NAME=demo-postgres-${RANDOM_SUFFIX}
30+
echo "$INSTANCE_NAME" > "${ROOT}"/.instance
31+
2732
if [ -z "$INSTANCE_NAME" ] ; then
2833
help
2934
exit 1
3035
fi
3136

32-
export USER_NAME=$2
37+
export USER_NAME=$1
3338
if [ -z "$USER_NAME" ] ; then
3439
help
3540
exit 1
3641
fi
3742

38-
export PG_ADMIN_CONSOLE_EMAIL=$3
43+
export PG_ADMIN_CONSOLE_EMAIL=$2
3944
if [ -z "$PG_ADMIN_CONSOLE_EMAIL" ]; then
4045
help
4146
exit 1

teardown.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ help() {
2525
echo "./teardown.sh INSTANCE_NAME"
2626
}
2727

28-
export INSTANCE_NAME=$1
28+
INSTANCE_NAME=$(cat "${ROOT}"/.instance)
29+
export INSTANCE_NAME
2930
if [ -z "$INSTANCE_NAME" ] ; then
3031
help
3132
exit 1

validate.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ if [ -z "$CLUSTER_ZONE" ]; then
3030
exit 1
3131
fi
3232

33-
export INSTANCE_NAME=$1
33+
INSTANCE_NAME=$(cat "${ROOT}"/.instance)
34+
export INSTANCE_NAME
3435
if [ -z "$INSTANCE_NAME" ] ; then
3536
help
3637
exit 1

0 commit comments

Comments
 (0)