poetry run ./manage.py create_oidc_client dashboard public --client-id"${DASHBOARD_OIDC_CLIENT_ID}"--client-secret"${DASHBOARD_OIDC_CLIENT_SECRET}"-r"id_token token"-u"${DASHBOARD_CALLBACK_BASE_URL}/oidc_callback.html"-u"${DASHBOARD_CALLBACK_BASE_URL}/oidc_callback_silentRenew.html"-p"${DASHBOARD_CALLBACK_BASE_URL}"-p"${DASHBOARD_CALLBACK_BASE_URL}/"
poetry run ./manage.py create_oidc_client tank confidential --client-id"${TANK_OIDC_CLIENT_ID}"--client-secret"${TANK_OIDC_CLIENT_SECRET}"-r"code"-u"${TANK_CALLBACK_BASE_URL}/tank/auth/oidc/callback"
poetry run ./manage.py addpermissions
poetry run ./manage.py creatersakey
fi
# FIXME: these should be in the initialization or execute inside the running container
if["$command"="loaddata.custom"];then
# from the docker-compose volume
poetry run ./manage.py loaddata fixtures/custom/*.json
elif["$command"="loaddata.sample"];then
# from the steering Docker image
poetry run ./manage.py loaddata fixtures/sample/*.json
fi
# start the application
if["$command"="run.prod"];then
poetry run ./manage.py migrate --no-input
poetry run ./manage.py collectstatic --no-input
poetry run gunicorn --bind 0.0.0.0:8000 --workers"$(nproc)" steering.wsgi
elif["$command"="run.dev"];then
poetry run ./manage.py migrate --no-input
poetry run ./manage.py collectstatic --no-input
poetry run ./manage.py runserver 0.0.0.0:8000
fi
done
poetry run ./manage.py migrate --no-input
if["$1"="run.prod"];then
# TODO: is there another way to pass `$(nproc)`?
poetry run gunicorn --bind 0.0.0.0:8000 --workers"$(nproc)" steering.wsgi