Skip to content

Commit

Permalink
feat: strip .git from any repo urls make token a secret
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeMac committed Nov 21, 2024
1 parent 1962fe0 commit 9380b6e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions start.sh
Original file line number Diff line number Diff line change
@@ -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: <empty> (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: <empty> (read-only pipeline)]: " token
echo ""
echo "Creating cluster..."
fi

kind create cluster \
--wait 120s \
--config - <<EOF
--config - <<EOF || echo "Cluster already exists"
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name: glu-gitops-example
Expand Down

0 comments on commit 9380b6e

Please sign in to comment.