From eeb03c8039bbce5f4d071ff8107961e1a89f49d6 Mon Sep 17 00:00:00 2001 From: czichy Date: Mon, 20 Jun 2022 16:16:16 +0300 Subject: [PATCH] servecm installation check changed previously we had a simple sleep when installing servecm. now we have a check if servecm is up and running. Signed-off-by: czichy Change-Id: I10c0b6b0c504f1d1a56cbd485e38cb4a79b6f487 --- bin/install_common_templates_to_helm.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bin/install_common_templates_to_helm.sh b/bin/install_common_templates_to_helm.sh index 39f30b8..09d597c 100755 --- a/bin/install_common_templates_to_helm.sh +++ b/bin/install_common_templates_to_helm.sh @@ -25,12 +25,16 @@ nohup helm servecm --port=8879 --context-path=/charts --storage local --storage- yes EOF -echo "sleeping for 5 seconds" -sleep 5 - -echo "checking that servecm is working with this curl command" -curl --silent --output /dev/null http://127.0.0.1:8879/charts -echo "success="$? +CURL_CMD="curl --silent --output /dev/null http://127.0.0.1:8879/charts" +`${CURL_CMD}` +READY=$? +while [ ${READY} != 0 ]; do + echo "servecm not yet running. sleeping for 2 seconds" + sleep 2 + `${CURL_CMD}` + READY=$? +done +echo "servcm up and running" eval $(helm env |grep HELM_REPOSITORY_CACHE) echo ${HELM_REPOSITORY_CACHE} -- 2.16.6