Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check Elasticsearch connection before setup:install #326

Merged
merged 1 commit into from
Jan 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion compose/bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
source env/db.env
BASE_URL=${1:-magento2.test}

ES_HOST=elasticsearch
ES_PORT=9200

bin/stop

docker-compose -f docker-compose.yml up -d
Expand Down Expand Up @@ -48,6 +51,14 @@ echo "Forcing reinstall of composer deps to ensure perms & reqs..."
bin/clinotty composer global require hirak/prestissimo
bin/clinotty composer update

echo "Waiting for connection to Elasticsearch..."
bin/clinotty timeout 30 bash -c "
until curl --silent --output /dev/null http://$ES_HOST:$ES_PORT/_cat/health?h=st; do
printf '.'
sleep 5
done"
[ $? != 0 ] && echo "Failed to connect to Elasticsearch" && exit

bin/clinotty bin/magento setup:install \
--db-host=$MYSQL_HOST \
--db-name=$MYSQL_DATABASE \
Expand Down Expand Up @@ -80,7 +91,8 @@ bin/clinotty bin/magento setup:install \
--session-save-redis-log-level=4 \
--session-save-redis-db=2 \
--search-engine=elasticsearch7 \
--elasticsearch-host=elasticsearch \
--elasticsearch-host=$ES_HOST \
--elasticsearch-port=$ES_PORT \
--use-rewrites=1

echo "Turning on developer mode.."
Expand Down