1
- #! /bin/sh
1
+ #! /bin/bash
2
+
3
+ DEBUG=${DEBUG:- false}
4
+
5
+ if [ " ${DEBUG} " = " true" ]; then
6
+ set -x
7
+ fi
2
8
3
9
set -e
10
+
4
11
COL=' \033[92m'
5
12
RED=' \033[91m'
6
13
COL_RES=' \033[0m'
@@ -9,7 +16,7 @@ SCRIPT_DIR=$(dirname "$0")
9
16
10
17
# Check for input argument GH_TOKEN and echo message in case not provided
11
18
if [ -z " ${GH_TOKEN} " ]; then
12
- echo " Please set the 'GITHUB_TOKEN ' environment variable with a GitHub token that has 'read:packages' scope."
19
+ echo " Please set the 'GH_TOKEN ' environment variable with a GitHub token that has 'read:packages' scope."
13
20
exit 1
14
21
else
15
22
ghToken=$GH_TOKEN
@@ -32,26 +39,26 @@ if [ $(kind get clusters | grep -c openmfp) -gt 0 ]; then
32
39
echo -e " ${COL} [$( date ' +%H:%M:%S' ) ] Kind cluster already running, using existing ${COL_RES} "
33
40
kind export kubeconfig --name openmfp
34
41
else
35
- echo " ${COL} [$( date ' +%H:%M:%S' ) ] Creating kind cluster ${COL_RES} "
42
+ echo -e " ${COL} [$( date ' +%H:%M:%S' ) ] Creating kind cluster ${COL_RES} "
36
43
kind create cluster --config $SCRIPT_DIR /../kind/kind-config.yaml --name openmfp --image=kindest/node:v1.30.2
37
44
fi
38
45
39
- echo " ${COL} [$( date ' +%H:%M:%S' ) ] Installing flux ${COL_RES} "
46
+ echo -e " ${COL} [$( date ' +%H:%M:%S' ) ] Installing flux ${COL_RES} "
40
47
helm upgrade -i -n flux-system --create-namespace flux oci://ghcr.io/fluxcd-community/charts/flux2 \
41
48
--set imageAutomationController.create=false \
42
49
--set imageReflectionController.create=false \
43
50
--set kustomizeController.create=false \
44
51
--set notificationController.create=false
45
52
46
- echo " ${COL} [$( date ' +%H:%M:%S' ) ] Starting deployments ${COL_RES} "
53
+ echo -e " ${COL} [$( date ' +%H:%M:%S' ) ] Starting deployments ${COL_RES} "
47
54
kubectl apply -k $SCRIPT_DIR /../kustomize/overlays/default
48
55
49
- echo " ${COL} [$( date ' +%H:%M:%S' ) ] Creating necessary secrets ${COL_RES} "
56
+ echo -e " ${COL} [$( date ' +%H:%M:%S' ) ] Creating necessary secrets ${COL_RES} "
50
57
kubectl create secret docker-registry ghcr-credentials -n openmfp-system --docker-server=ghcr.io --docker-username=$ghUser --docker-password=$ghToken --dry-run=client -o yaml | kubectl apply -f -
51
58
52
59
kubectl create secret generic keycloak-admin -n openmfp-system --from-literal=secret=admin --dry-run=client -o yaml | kubectl apply -f -
53
60
54
- echo " ${COL} [$( date ' +%H:%M:%S' ) ] Waiting for istio to become ready ${COL_RES} "
61
+ echo -e " ${COL} [$( date ' +%H:%M:%S' ) ] Waiting for istio to become ready ${COL_RES} "
55
62
kubectl wait --namespace istio-system \
56
63
--for=condition=Ready helmreleases \
57
64
--timeout=120s istio-base
@@ -64,18 +71,20 @@ kubectl wait --namespace istio-system \
64
71
--for=condition=Ready helmreleases \
65
72
--timeout=120s istio-gateway
66
73
67
- echo " ${COL} [$( date ' +%H:%M:%S' ) ] Waiting for OpenMFP to become ready ${COL_RES} (this may take a few minutes)"
74
+ echo -e " ${COL} [$( date ' +%H:%M:%S' ) ] Waiting for OpenMFP CRDs to become ready ${COL_RES} (this may take a few minutes)"
68
75
69
76
kubectl wait --namespace openmfp-system \
70
77
--for=condition=Ready helmreleases \
71
- --timeout=480s openmfp-crds
78
+ --timeout=280s openmfp-crds
79
+
80
+ echo -e " $COL Waiting for OpenMFP to become ready $COL_RES (this may take a while)"
72
81
73
82
kubectl wait --namespace openmfp-system \
74
83
--for=condition=Ready helmreleases \
75
84
--timeout=480s openmfp
76
85
77
- echo " ${COL} -------------------------------------${COL_RES} "
78
- echo " ${COL} [$( date ' +%H:%M:%S' ) ] Installation Complete ${RED} ♥${COL} !${COL_RES} "
79
- echo " ${COL} -------------------------------------${COL_RES} "
80
- echo " ${COL} You can access the portal at: http://localhost:8000${COL_RES} "
86
+ echo -e " ${COL} -------------------------------------${COL_RES} "
87
+ echo -e " ${COL} [$( date ' +%H:%M:%S' ) ] Installation Complete ${RED} ♥${COL} !${COL_RES} "
88
+ echo -e " ${COL} -------------------------------------${COL_RES} "
89
+ echo -e " ${COL} You can access the portal at: http://localhost:8000${COL_RES} "
81
90
exit 0
0 commit comments