X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=bin%2Fprepare-common-templates;h=8743260609d16441c4ce1dfa97c3ac696737afea;hb=refs%2Fchanges%2F50%2F6450%2F3;hp=255c32d3b19195af120626c01f0161e4e8d65555;hpb=a72e0f1c2ae78ab9eadacf5e7b3df53998584a72;p=it%2Fdep.git diff --git a/bin/prepare-common-templates b/bin/prepare-common-templates index 255c32d3..87432606 100755 --- a/bin/prepare-common-templates +++ b/bin/prepare-common-templates @@ -20,7 +20,7 @@ ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" #Check for helm3 -IS_HELM3=$(helm version --short|grep -e "^v3") +IS_HELM3=$(helm version -c --short|grep -e "^v3") # Start Helm local repo if there isn't one HELM_REPO_PID=$(ps -x | grep "helm serve" | grep -v "grep" | awk '{print $1}') @@ -35,6 +35,18 @@ then fi fi +# Check if servecm plugin is ready to serve request +command='curl --silent --output /dev/null http://127.0.0.1:8879/charts' +for i in $(seq 1 5) +do $command && s=0 && break || s=$? && echo "Error connecting chartmuseum server. Retrying after 5s" && sleep 5; +done + +if [ $s -gt 0 ] +then + echo "Cmd to test chartmuseum failed with ($s): $command" + exit $s +fi + # Package common templates and serve it using Helm local repo if [ $IS_HELM3 ] then