WSL/SLF GitLab Repository

Commit 05108ab3 authored by Sam's avatar Sam
Browse files

update entrypoint to test solr

parent 814e4967
......@@ -15,6 +15,8 @@ if [ -z "$CKAN_CONFIG_PATH" ]; then
ln -sf /run/secrets/ckan_config "$CONFIG"
echo "Extracting CKAN_SQLALCHEMY_URL"
CKAN_SQLALCHEMY_URL=$(awk -F " = " '/sqlalchemy.url/ {print $2;exit;}' "$CONFIG")
SOLR_USER=$(awk -F " = " '/solr_user/ {print $2;exit;}' "$CONFIG")
SOLR_PASS=$(awk -F " = " '/solr_password/ {print $2;exit;}' "$CONFIG")
else
abort "ERROR: CKAN_CONFIG_PATH specified, but file doesn't exist."
fi
......@@ -28,4 +30,17 @@ while ! pg_isready -d "$CKAN_SQLALCHEMY_URL"; do
sleep 1;
done
# Wait for Solr
while [[ $response != "200" ]]; do
response=$(curl --user "$SOLR_USER:$SOLR_PASS" \
-s -o /dev/null -I -w '%{http_code}' \
http://solr:8983/solr/admin/cores?action=STATUS)
if [[ $response != "200" ]]; then
echo "No response from Solr. Is it running?"
sleep 5;
else
echo "Successfully connected to Solr."
fi
done
exec "$@"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment