diff --git a/run.sh b/run.sh old mode 100644 new mode 100755 index e241c84..bdd0bc9 --- a/run.sh +++ b/run.sh @@ -1,6 +1,27 @@ #!/usr/bin/env bash -minikube start -./build.sh -b -minikube addons enable ingress -helm install exam ./helm +minikube status | grep -q "Running" && START_MINIKUBE=false || START_MINIKUBE=true + +$START_MINIKUBE && minikube start +$START_MINIKUBE && eval $(minikube docker-env) + +read -p "Do you want to run Postgres with a specific version? [y/N]: " answer + +if [ "$answer" == "y" ] || [ "$answer" == "Y" ]; then + read -p "Enter the Postgres version: " version + ./build.sh -b -v "${version}" + sed -ni "/repository: db/ { + p; + n; + /tag:.*/ { + s/tag:.*/tag: ${version}/; + p; + d; + } + } + p;" helm/values.yaml +fi + +$START_MINIKUBE && minikube addons enable ingress + +helm status exam > /dev/null 2>&1 && helm upgrade exam ./helm || helm install exam ./helm