diff --git a/oioioi_init.sh b/oioioi_init.sh index 8bea4c15d..a924fad58 100755 --- a/oioioi_init.sh +++ b/oioioi_init.sh @@ -5,6 +5,18 @@ set -x /sio2/oioioi/wait-for-it.sh -t 60 "${DATABASE_HOST:-db}:${DATABASE_PORT:-5432}" if [ "$1" == "--dev" ]; then + echo "Checking frontend dependencies..." + + if ! (cd ../oioioi && npm list --depth=0 > /dev/null 2>&1); then + echo "Dependencies mismatch or missing. Running npm install..." + (cd ../oioioi && npm install) + else + echo "Dependencies are up to date." + fi + + echo "Building frontend assets..." + (cd ../oioioi && npm run build) + ./manage.py migrate 2>&1 | tee /sio2/deployment/logs/migrate.log ./manage.py loaddata ../oioioi/extra/dbdata/default_admin.json