This repository was archived by the owner on Dec 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·53 lines (43 loc) · 1.57 KB
/
start.sh
File metadata and controls
executable file
·53 lines (43 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
set -eo pipefail
kind create cluster \
--wait 120s \
--config - <<EOF 2>/dev/null || echo "Cluster already exists"
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name: glu-gitops-example
nodes:
- extraPortMappings:
- containerPort: 30080 # glu pipeline
hostPort: 30080
- containerPort: 30081 # app in staging
hostPort: 30081
- containerPort: 30082 # app in production
hostPort: 30082
EOF
if ! command -v go 2>&1 >/dev/null; then
echo "Please install Go (>=1.23)"
exit 1
fi
if ! command -v timoni 2>&1 >/dev/null; then
go install github.com/stefanprodan/timoni/cmd/timoni@latest
fi
echo ""
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}"
repository="${repository%.git}"
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
CONFIGURATION_REPOSITORY_URL="${repository}" \
CONFIGURATION_REPOSITORY_PASSWORD="${token}" \
timoni bundle apply --kube-context kind-glu-gitops-example -f timoni/flux-aio.cue --runtime-from-env
echo "##########################################"
echo "# #"
echo "# Pipeline Ready: http://localhost:30080 #"
echo "# #"
echo "##########################################"