Skip to content

Commit

Permalink
Merge branch 'develop' into feature/form-room
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeySafronov committed Apr 25, 2024
2 parents 701d55d + 7518c63 commit 4fe602c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions install/common/product-configuration
Original file line number Diff line number Diff line change
Expand Up @@ -627,12 +627,6 @@ change_elasticsearch_config(){
systemctl stop opensearch
systemctl is-active --quiet elasticsearch && systemctl stop elasticsearch

ELASTIC_VERSION=$(awk '/build:/{f=1} f&&/version:/{gsub(/"/,"",$2);print $2; exit}' /usr/share/opensearch/manifest.yml 2>/dev/null || echo "2.11.1")
[[ -f "$APP_DIR/.private/opensearch-version" && $(cat $APP_DIR/.private/opensearch-version) != *$ELASTIC_VERSION* ]] && $MYSQL "$DB_NAME" -e "TRUNCATE webstudio_index";

echo "$ELASTIC_VERSION" > $APP_DIR/.private/opensearch-version
chmod o-rwx $APP_DIR/.private/opensearch-version

sed -i '/^plugins\.security/d' /etc/opensearch/opensearch.yml
sed -i '/CN=kirk,OU=client,O=client,L=test, C=de/d' /etc/opensearch/opensearch.yml
if /usr/share/opensearch/bin/opensearch-plugin list | grep -x "opensearch-security" > /dev/null 2>&1 ; then
Expand Down Expand Up @@ -907,3 +901,11 @@ elif $PACKAGE_MANAGER rabbitmq-server >/dev/null 2>&1; then
fi

restart_services

# Truncate MySQL DB to make opensearch work with updated app. Strictly after restart_services ()
if $PACKAGE_MANAGER opensearch >/dev/null 2>&1; then
ELASTIC_VERSION=$(awk '/build:/{f=1} f&&/version:/{gsub(/"/,"",$2);print $2; exit}' /usr/share/opensearch/manifest.yml 2>/dev/null || echo "2.11.1")
[[ ! -f "$APP_DIR/.private/opensearch-version" || $(cat "$APP_DIR/.private/opensearch-version") != *"$ELASTIC_VERSION"* ]] && $MYSQL "$DB_NAME" -e "TRUNCATE webstudio_index";
echo "$ELASTIC_VERSION" > $APP_DIR/.private/opensearch-version
chmod o-rwx $APP_DIR/.private/opensearch-version
fi

0 comments on commit 4fe602c

Please sign in to comment.