From fea0b9a1b6add1a882087f0615fb5f1ebfcaf896 Mon Sep 17 00:00:00 2001 From: Benjamin Calef Date: Mon, 27 Mar 2023 16:03:18 +0200 Subject: [PATCH] [v1.7.1] fix error on elasticsearch installation --- provision/001-system-env.sh | 10 ++++++++-- provision/120-magento-post.sh | 8 +------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/provision/001-system-env.sh b/provision/001-system-env.sh index 6b3d522..80373b6 100644 --- a/provision/001-system-env.sh +++ b/provision/001-system-env.sh @@ -35,8 +35,14 @@ fi # search engine SEARCH_ENGINE=${21} -if [ "$SEARCH_ENGINE" != "opensearch" ] || $(dpkg --compare-versions "${PROJECT_VERSION}" "lt" "2.4.6"); then - SEARCH_ENGINE='elasticsearch' +if [ "$SEARCH_ENGINE" != "opensearch" ]; then + if $(dpkg --compare-versions "${PROJECT_VERSION}" "ge" "2.4.6"); then + SEARCH_ENGINE='elasticsearch8' + elif $(dpkg --compare-versions "${PROJECT_VERSION}" "ge" "2.4.0"); then + SEARCH_ENGINE='elasticsearch7' + else + SEARCH_ENGINE='elasticsearch6' + fi fi # two factor auth diff --git a/provision/120-magento-post.sh b/provision/120-magento-post.sh index 486b378..1e4e80e 100644 --- a/provision/120-magento-post.sh +++ b/provision/120-magento-post.sh @@ -89,13 +89,7 @@ if $(dpkg --compare-versions "${PROJECT_VERSION}" "gt" "2.2"); then if [ "$PROJECT_SEARCH_ENGINE" == "opensearch" ]; then sudo -u vagrant "$PROJECT_PATH"/bin/magento config:set "catalog/search/engine" "opensearch" else - if $(dpkg --compare-versions "${PROJECT_VERSION}" "ge" "2.4.6"); then - sudo -u vagrant "$PROJECT_PATH"/bin/magento config:set "catalog/search/engine" "elasticsearch8" - elif $(dpkg --compare-versions "${PROJECT_VERSION}" "ge" "2.4.0"); then - sudo -u vagrant "$PROJECT_PATH"/bin/magento config:set "catalog/search/engine" "elasticsearch7" - else - sudo -u vagrant "$PROJECT_PATH"/bin/magento config:set "catalog/search/engine" "elasticsearch6" - fi + sudo -u vagrant "$PROJECT_PATH"/bin/magento config:set "catalog/search/engine" $PROJECT_SEARCH_ENGINE fi else # Force https on unsecure request for older versions