From 748532bb101e7f61ddc4db75568de73dd59f280d Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 10 Oct 2023 08:28:49 +0000 Subject: [PATCH] dev: work on action --- warden/setup-environment/action.yml | 47 ++++++++++++++--------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/warden/setup-environment/action.yml b/warden/setup-environment/action.yml index 24f7658..a84ef71 100644 --- a/warden/setup-environment/action.yml +++ b/warden/setup-environment/action.yml @@ -218,46 +218,43 @@ runs: SEARCH: ${{ inputs.search }} run: | export DEN="$(dirname $(pwd))/warden/bin/warden" + case "${SEARCH}" in + elasticsearch:*) + SEARCH_HOST="elasticsearch" + ;; + *) + SEARCH_HOST="opensearch" + ;; + esac + echo "search host: ${SEARCH_HOST}" echo "===================================================" - docker ps -a - ${DEN} env exec -T php-fpm bash -c "curl --write-out %{http_code} --silent --output /dev/null http://elasticsearch:9200/_cat/health?h=st; exit 0" + SEARCH_STATUS=$(${DEN} env exec -T php-fpm bash -c "curl --write-out %{http_code} --silent --output /dev/null http://elasticsearch:9200/_cat/health?h=st; exit 0") + echo "search status: ${SEARCH_STATUS}" sleep 10 echo "===================================================" - docker ps -a - ${DEN} env exec -T php-fpm bash -c "curl --write-out %{http_code} --silent --output /dev/null http://elasticsearch:9200/_cat/health?h=st; exit 0" + SEARCH_STATUS=$(${DEN} env exec -T php-fpm bash -c "curl --write-out %{http_code} --silent --output /dev/null http://elasticsearch:9200/_cat/health?h=st; exit 0") + echo "search status: ${SEARCH_STATUS}" sleep 10 echo "===================================================" - docker ps -a - ${DEN} env exec -T php-fpm bash -c "curl --write-out %{http_code} --silent --output /dev/null http://elasticsearch:9200/_cat/health?h=st; exit 0" + SEARCH_STATUS=$(${DEN} env exec -T php-fpm bash -c "curl --write-out %{http_code} --silent --output /dev/null http://elasticsearch:9200/_cat/health?h=st; exit 0") + echo "search status: ${SEARCH_STATUS}" sleep 10 echo "===================================================" - docker ps -a - ${DEN} env exec -T php-fpm bash -c "curl --write-out %{http_code} --silent --output /dev/null http://elasticsearch:9200/_cat/health?h=st; exit 0" + SEARCH_STATUS=$(${DEN} env exec -T php-fpm bash -c "curl --write-out %{http_code} --silent --output /dev/null http://elasticsearch:9200/_cat/health?h=st; exit 0") + echo "search status: ${SEARCH_STATUS}" sleep 10 echo "===================================================" - docker ps -a - ${DEN} env exec -T php-fpm bash -c "curl --write-out %{http_code} --silent --output /dev/null http://elasticsearch:9200/_cat/health?h=st; exit 0" + SEARCH_STATUS=$(${DEN} env exec -T php-fpm bash -c "curl --write-out %{http_code} --silent --output /dev/null http://elasticsearch:9200/_cat/health?h=st; exit 0") + echo "search status: ${SEARCH_STATUS}" sleep 10 echo "===================================================" - docker ps -a - ${DEN} env exec -T php-fpm bash -c "curl --write-out %{http_code} --silent --output /dev/null http://elasticsearch:9200/_cat/health?h=st; exit 0" - - echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" - ${DEN} env exec -T php-fpm bash -c "curl --write-out %{http_code} --silent --output /dev/null http://elasticsearch:9200/_cat/health?h=st; exit 0" - - echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + SEARCH_STATUS=$(${DEN} env exec -T php-fpm bash -c "curl --write-out %{http_code} --silent --output /dev/null http://elasticsearch:9200/_cat/health?h=st; exit 0") + echo "search status: ${SEARCH_STATUS}" # curl --write-out %{http_code} --silent --output /dev/null http://mageos-elasticsearch-1:9200/_cat/health?h=st echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" # export DEN="$(dirname $(pwd))/warden/bin/warden" -# case "${SEARCH}" in -# elasticsearch:*) -# SEARCH_HOST="elasticsearch" -# ;; -# *) -# SEARCH_HOST="opensearch" -# ;; -# esac + # # TODO #