Skip to content

Commit

Permalink
[v1.7.1] fix error on elasticsearch installation
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Calef committed Mar 27, 2023
1 parent 73af199 commit fea0b9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 8 additions & 2 deletions provision/001-system-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions provision/120-magento-post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fea0b9a

Please sign in to comment.