Skip to content

Commit

Permalink
Refactor setup and teardown scripts to remove search engine profile h…
Browse files Browse the repository at this point in the history
…andling and simplify Docker commands
  • Loading branch information
mescalantea committed Mar 6, 2025
1 parent ce46449 commit 6d60000
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ M2_TIMEZONE="Europe/Madrid"
M2_SEARCH_ENGINE=opensearch
M2_SEARCH_ENGINE_HOST=opensearch

COMPOSE_PROFILES=$M2_SEARCH_ENGINE_HOST

M2_SEARCH_ENGINE_PORT=9200
M2_SEARCH_ENGINE_INDEX_PREFIX=m2
M2_SEARCH_ENGINE_TIMEOUT=60
Expand Down
10 changes: 5 additions & 5 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ if [ $ngrok -eq 1 ]; then
echo "✅ Ngrok started. Public URL: $M2_URL"
fi

search_engine_profile="elasticsearch"
if [ "$M2_SEARCH_ENGINE_HOST" == 'opensearch' ]; then
search_engine_profile="opensearch"
fi
# search_engine_profile="elasticsearch"
# if [ "$M2_SEARCH_ENGINE_HOST" == 'opensearch' ]; then
# search_engine_profile="opensearch"
# fi

docker compose --profile "$search_engine_profile" up -d || exit 1
docker compose up -d || exit 1

echo "🚀 Waiting for installation to complete..."

Expand Down
10 changes: 5 additions & 5 deletions teardown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ set -o allexport
source .env
set +o allexport

search_engine_profile="elasticsearch"
if [ "$M2_SEARCH_ENGINE_HOST" == 'opensearch' ]; then
search_engine_profile="opensearch"
fi
# search_engine_profile="elasticsearch"
# if [ "$M2_SEARCH_ENGINE_HOST" == 'opensearch' ]; then
# search_engine_profile="opensearch"
# fi

docker compose --profile "$search_engine_profile" down --volumes --remove-orphans
docker compose down --volumes --remove-orphans
docker rm -f $NGROK_CONTAINER_NAME || true

0 comments on commit 6d60000

Please sign in to comment.