#!/bin/bash

# Create a superuser from environment variables (e.g. with a Cloud Run job)

set -euo pipefail

cd ~/promptgame/
./manage.py check --deploy
# createsuperuser gets the password from APPLICATION_SETTINGS, which contains
# DJANGO_SUPERUSER_PASSWORD (note that our promptgame.settings.cloud_run is
# responsible for setting this environment variable as a side-effect, which is a
# bit weird but it works)
./manage.py createsuperuser --username root --email robust-llms@berkeley.edu --no-input
