funkwhale/abra.sh

45 lines
1.1 KiB
Bash
Raw Normal View History

2022-05-16 09:53:21 +00:00
export NGINX_CONFIG_VERSION=v2
2022-05-10 12:54:46 +00:00
export APP_ENTRYPOINT_VERSION=v1
2022-05-10 09:12:35 +00:00
secrets() {
docker context use default > /dev/null 2>&1
2022-05-10 10:08:58 +00:00
2022-05-10 09:12:35 +00:00
DJANGO_SECRET_KEY=$(openssl rand -base64 45)
abra app secret insert "$APP_NAME" django_secret_key v1 "$DJANGO_SECRET_KEY"
2022-05-10 10:08:58 +00:00
echo "DJANGO_SECRET_KEY = $DJANGO_SECRET_KEY"
2022-05-10 09:12:35 +00:00
}
2022-05-10 09:32:50 +00:00
migrate(){
# run against the "api" service
2022-05-10 11:31:35 +00:00
export DJANGO_SECRET_KEY=$(cat /run/secrets/django_secret_key)
DATABASE_PASSWORD=$(cat /run/secrets/db_password)
export DATABASE_URL="postgres://funkwhale:$DATABASE_PASSWORD@db:5432/funkwhale"
2022-05-10 09:32:50 +00:00
python manage.py migrate
}
admin() {
# run against the "api" service
2022-05-10 11:31:35 +00:00
export DJANGO_SECRET_KEY=$(cat /run/secrets/django_secret_key)
DATABASE_PASSWORD=$(cat /run/secrets/db_password)
export DATABASE_URL="postgres://funkwhale:$DATABASE_PASSWORD@db:5432/funkwhale"
2022-05-10 09:32:50 +00:00
python manage.py createsuperuser
}
2022-05-10 11:31:35 +00:00
static() {
# run against the "api" service
export DJANGO_SECRET_KEY=$(cat /run/secrets/django_secret_key)
DATABASE_PASSWORD=$(cat /run/secrets/db_password)
export DATABASE_URL="postgres://funkwhale:$DATABASE_PASSWORD@db:5432/funkwhale"
python manage.py collectstatic --no-input
}