From 483ee7ce1fd8c74d620c8de6afad4d4005a21fe6 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 10 Oct 2023 09:21:20 +0000 Subject: [PATCH] dev: work on action --- warden/setup-environment/action.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/warden/setup-environment/action.yml b/warden/setup-environment/action.yml index 3c33d46..36bc3be 100644 --- a/warden/setup-environment/action.yml +++ b/warden/setup-environment/action.yml @@ -226,7 +226,18 @@ runs: SEARCH_HOST="opensearch" ;; esac - echo "search host: ${SEARCH_HOST}" + HEALTHY=1 + for ((i=1; i<=24; i++)); do + SEARCH_STATUS=$(${DEN} env exec -T php-fpm bash -c "curl --write-out %{http_code} --silent --output /dev/null http://${SEARCH_HOST}:9200/_cat/health?h=st; exit 0") + echo "search status: ${SEARCH_STATUS}" + if [ ${SEARCH_STATUS} -eq "200" ]; then + HEALTHY=0 + break + fi + sleep 5 + done + echo "HEALTHY: ${HEALTHY}" + exit ${HEALTHY} echo "===================================================" SEARCH_STATUS=$(${DEN} env exec -T php-fpm bash -c "curl --write-out %{http_code} --silent --output /dev/null http://${SEARCH_HOST}:9200/_cat/health?h=st; exit 0") echo "search status: ${SEARCH_STATUS}"