Skip to content

fix(docker-entrypoint): startup with new search index for all existing trees #532

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

Closed
wants to merge 2 commits into from
Closed
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
11 changes: 8 additions & 3 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ then
fi

# Create search index if not exists
if [ -z "$(ls -A /app/indexdir/*.db)" ]
then
python3 -m gramps_webapi --config /app/config/config.cfg search index-full
if [ ! -f /app/indexdir/search_index.db ]; then
if [ "${GRAMPSWEB_TREE}" = "*" ]; then
for GRAMPSWEB_TREE in $(python3 -m gramps_webapi --config /app/config/config.cfg tree list | awk '{print $1;}' | grep -v Tree); do
python3 -m gramps_webapi --config /app/config/config.cfg search index-full;
done
else
python3 -m gramps_webapi --config /app/config/config.cfg search index-full;
fi
fi

# Run migrations for user database, if any
Expand Down