Skip to content

Commit

Permalink
Allow script to run independent of cwd and use VERSION file.
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Trent <[email protected]>
  • Loading branch information
trent-s committed Oct 1, 2024
1 parent 1c0aeef commit b382019
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions deployment/setup-local.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# no matter how the script is invoked, TOP will point to the "deployment"
# directory and hence can be used to access files relative
# to the known directory of the setup-local.sh script.

TOP=$(dirname $0)

set -e
set -o pipefail

Expand All @@ -17,7 +23,7 @@ export CLUSTER_NAME="local-cluster"
if kind get clusters | grep -q "$CLUSTER_NAME"; then
echo "> Kind cluster $CLUSTER_NAME already exists"
else
kind create cluster --name="$CLUSTER_NAME" --config=./deployment/local-cluster-config.yaml
kind create cluster --name="$CLUSTER_NAME" --config=${TOP}/local-cluster-config.yaml
fi

# Install Prometheus via Helm
Expand Down Expand Up @@ -53,7 +59,7 @@ GF_POD=$(
-l app.kubernetes.io/name=grafana \
-o jsonpath="{.items[0].metadata.name}"
)
kubectl cp deployment/kepler_dashboard.json monitoring/$GF_POD:/tmp/dashboards/kepler_dashboard.json
kubectl cp ${TOP}/kepler_dashboard.json monitoring/$GF_POD:/tmp/dashboards/kepler_dashboard.json


# echo "> Install OLM"
Expand All @@ -65,10 +71,10 @@ kubectl cp deployment/kepler_dashboard.json monitoring/$GF_POD:/tmp/dashboards/k
# kubectl create -f https://operatorhub.io/install/susql-operator.yaml

# echo "> Wait for susql to be ready"
# kubectl wait --for=condition=Installed csv/susql-operator.v0.0.30 -n operators --timeout=300s
# kubectl wait --for=condition=Installed csv/susql-operator.v$(cat ${TOP}/../VERSION) -n operators --timeout=300s


# Optional: Delete Kind cluster after use
# kind delete cluster --name="$CLUSTER_NAME"

echo "> Done"
echo "> Done"

0 comments on commit b382019

Please sign in to comment.