Skip to content

Commit fea0b9a

Browse files
author
Benjamin Calef
committed
[v1.7.1] fix error on elasticsearch installation
1 parent 73af199 commit fea0b9a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

provision/001-system-env.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,14 @@ fi
3535

3636
# search engine
3737
SEARCH_ENGINE=${21}
38-
if [ "$SEARCH_ENGINE" != "opensearch" ] || $(dpkg --compare-versions "${PROJECT_VERSION}" "lt" "2.4.6"); then
39-
SEARCH_ENGINE='elasticsearch'
38+
if [ "$SEARCH_ENGINE" != "opensearch" ]; then
39+
if $(dpkg --compare-versions "${PROJECT_VERSION}" "ge" "2.4.6"); then
40+
SEARCH_ENGINE='elasticsearch8'
41+
elif $(dpkg --compare-versions "${PROJECT_VERSION}" "ge" "2.4.0"); then
42+
SEARCH_ENGINE='elasticsearch7'
43+
else
44+
SEARCH_ENGINE='elasticsearch6'
45+
fi
4046
fi
4147

4248
# two factor auth

provision/120-magento-post.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,7 @@ if $(dpkg --compare-versions "${PROJECT_VERSION}" "gt" "2.2"); then
8989
if [ "$PROJECT_SEARCH_ENGINE" == "opensearch" ]; then
9090
sudo -u vagrant "$PROJECT_PATH"/bin/magento config:set "catalog/search/engine" "opensearch"
9191
else
92-
if $(dpkg --compare-versions "${PROJECT_VERSION}" "ge" "2.4.6"); then
93-
sudo -u vagrant "$PROJECT_PATH"/bin/magento config:set "catalog/search/engine" "elasticsearch8"
94-
elif $(dpkg --compare-versions "${PROJECT_VERSION}" "ge" "2.4.0"); then
95-
sudo -u vagrant "$PROJECT_PATH"/bin/magento config:set "catalog/search/engine" "elasticsearch7"
96-
else
97-
sudo -u vagrant "$PROJECT_PATH"/bin/magento config:set "catalog/search/engine" "elasticsearch6"
98-
fi
92+
sudo -u vagrant "$PROJECT_PATH"/bin/magento config:set "catalog/search/engine" $PROJECT_SEARCH_ENGINE
9993
fi
10094
else
10195
# Force https on unsecure request for older versions

0 commit comments

Comments
 (0)