From 9380b6ed139b318e0cce6329712d549858975a9c Mon Sep 17 00:00:00 2001 From: George MacRorie Date: Thu, 21 Nov 2024 16:23:22 +0000 Subject: [PATCH] feat: strip .git from any repo urls make token a secret --- start.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/start.sh b/start.sh index d4572dc..b384d2a 100755 --- a/start.sh +++ b/start.sh @@ -1,13 +1,22 @@ #!/bin/sh +set -eo pipefail + read -p "Enter your target gitops repo URL [default: https://github.com/get-glu/gitops-example]: " repository -repository="${repository:-https://github.com/get-glu/gitops-example.git}" +repository="${repository:-https://github.com/get-glu/gitops-example}" +repository="${repository%.git}" -read -p "Enter your GitHub personal access token [default: (read-only pipeline)]: " token +if kubectl -n glu get secret pipeline 2>&1 >/dev/null; then + token="$(kubectl -n glu get secret pipeline -o jsonpath='{.data.github_password}' | base64 -d)" +else + read -s -p "Enter your GitHub personal access token [default: (read-only pipeline)]: " token + echo "" + echo "Creating cluster..." +fi kind create cluster \ --wait 120s \ - --config - <