From 0149dd3fac615d4f67a0fb35c867317ef787eb3f Mon Sep 17 00:00:00 2001 From: Topvennie Date: Thu, 18 Apr 2024 23:05:34 +0200 Subject: [PATCH] chore: change seeding method --- development.sh | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/development.sh b/development.sh index 71c6f45a..351c3eab 100755 --- a/development.sh +++ b/development.sh @@ -75,41 +75,44 @@ fi # Seed database if data size is provided if [ "$data" != "" ]; then # Cleanup function - cleanup() { - echo "Ctrl+C detected. Cleaning up..." - deactivate - rm -rf .venv_dev - exit 1 - } + # cleanup() { + # echo "Ctrl+C detected. Cleaning up..." + # deactivate + # rm -rf .venv_dev + # exit 1 + # } - # Call cleanup function on SIGINT - trap cleanup SIGINT + # # Call cleanup function on SIGINT + # trap cleanup SIGINT echo "--------------------------" echo "Filling the database." echo "This can take some time..." echo "--------------------------" - cd backend + rm -f backend/db.sqlite3 > /dev/null 2>&1 + docker run -v backend:/code ugent-7_backend sh -c "python manage.py migrate; python manage.py loaddata */fixtures/small/*" > /dev/null + + # cd backend - rm -f db.sqlite3 > /dev/null 2>&1 + # rm -f db.sqlite3 > /dev/null 2>&1 - echo "Setting up workspace..." - python3 -m venv .venv_dev > /dev/null - source .venv_dev/bin/activate - pip install poetry > /dev/null - poetry install > /dev/null + # echo "Setting up workspace..." + # python3 -m venv .venv_dev > /dev/null + # source .venv_dev/bin/activate + # pip install poetry > /dev/null + # poetry install > /dev/null - echo "Migrating database..." - python manage.py migrate > /dev/null + # echo "Migrating database..." + # python manage.py migrate > /dev/null - echo "Filling $data database..." - python manage.py loaddata */fixtures/$data/* > /dev/null 2>&1 + # echo "Filling $data database..." + # python manage.py loaddata */fixtures/$data/* > /dev/null 2>&1 - echo "Resetting workspace..." - deactivate - rm -rf .venv_dev - cd .. + # echo "Resetting workspace..." + # deactivate + # rm -rf .venv_dev + # cd .. fi # Build Docker images