From 4973757e9f839cf5df141ae7f9a8b9e78c4d3f30 Mon Sep 17 00:00:00 2001 From: Kesara Rathnayake Date: Wed, 2 Oct 2024 17:34:45 +1300 Subject: [PATCH] build: Use postgresql dump files --- README.md | 2 +- .../database/02_convert_native_dump_to_sql_and_restore.sh | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9d0ce360..c2e55539 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ So the only requirement to run it locally is a recent version of Docker with doc ##### How to run (with a database dump) -1. Obtain a recent database dump with name like `ietfa.*.gz` and place in `docker/database/` directory. Otherwise, it will start with a fresh database. +1. Obtain a recent database dump with name like `ietf*.dump` and place in `docker/database/` directory. Otherwise, it will start with a fresh database. 2. Obtain and unarchive media files into `media/` folder. 3. Run `docker compose up`. It will build and start the frontend builder (`yarn run start`) and the backend (`python manage.py runserver` analog), along with a Postgresql database. The first run will take a while because the database dump needs to be restored. 4. After the frontend compilation finishes, the website should become available at http://localhost:8001 diff --git a/docker/database/02_convert_native_dump_to_sql_and_restore.sh b/docker/database/02_convert_native_dump_to_sql_and_restore.sh index 452bc5b5..d8da661c 100755 --- a/docker/database/02_convert_native_dump_to_sql_and_restore.sh +++ b/docker/database/02_convert_native_dump_to_sql_and_restore.sh @@ -5,7 +5,7 @@ cd /docker-entrypoint-initdb.d set +e -FILE=$(ls -1 ietfa.*.gz | head) +FILE=$(ls -1 *.dump | head) set -e @@ -16,13 +16,7 @@ restore_dump() { } if [ -s "${FILE}" ]; then - echo "Found ${FILE}, converting..." case $FILE in - *.gz) - echo "Restoring the gzipped archive..." - gzip -d -c $FILE | restore_dump - ;; - *) echo "Restoring the archive..." cat $FILE | restore_dump ;;