mirror of
https://github.com/boostorg/website-v2.git
synced 2026-02-23 16:22:08 +00:00
@@ -184,13 +184,7 @@ download_latest_db_dump() {
|
||||
docker compose exec db bash -c "pg_restore -U $DB_USER -d $DB_NAME -v --no-owner --no-privileges /tmp/$DUMP_FILENAME"
|
||||
# apply any migrations newer than our dumped database
|
||||
docker compose exec web bash -c "./manage.py migrate"
|
||||
# update the database to delete all rows from socialaccount_social app, which need to be configured differently locally
|
||||
echo "Deleting all rows from socialaccount_socialapp table and setting fake passwords..."
|
||||
docker compose exec web bash -c "./manage.py shell -c 'from allauth.socialaccount.models import SocialApp; SocialApp.objects.all().delete()'"
|
||||
just manage "set_fake_passwords --password=test"
|
||||
echo 'from django.contrib.auth import get_user_model; u=get_user_model().objects.get(email="superadmin@boost.org"); u.set_password("foobarone"); u.save()' | docker compose exec -T web python manage.py shell
|
||||
echo "Database restored successfully from $DUMP_FILENAME"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -199,6 +193,11 @@ if [ "${skip_web_option:-}" != "yes" ]; then
|
||||
echo "Failed to download and restore latest database dump";
|
||||
exit 1;
|
||||
}
|
||||
docker compose exec web bash -c "DJANGO_SUPERUSER_USERNAME=superadmin DJANGO_SUPERUSER_EMAIL=superadmin@boost.org DJANGO_SUPERUSER_PASSWORD=foobarone ./manage.py createsuperuser --noinput" || true
|
||||
# update the database to delete all rows from socialaccount_social app, which need to be configured differently locally
|
||||
echo "Deleting all rows from socialaccount_socialapp table and setting fake passwords..."
|
||||
docker compose exec web bash -c "./manage.py shell -c 'from allauth.socialaccount.models import SocialApp; SocialApp.objects.all().delete()'"
|
||||
just manage "set_fake_passwords --password=test"
|
||||
fi
|
||||
|
||||
if [ "${skip_lists_option:-}" != "yes" ]; then
|
||||
|
||||
Reference in New Issue
Block a user