Skip to content
Snippets Groups Projects
Verified Commit 952f61ef authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

fix: remove initialize & loadfixtures from the entrypoint

parent 8ff87029
No related branches found
No related tags found
No related merge requests found
Pipeline #7980 failed
#!/bin/sh
for command in "$@"; do
if [ "$command" = "initialize" ]; then
TANK_CALLBACK_BASE_URL=${TANK_CALLBACK_BASE_URL:-${AURA_PROTO}://${AURA_HOST}/tank}
DASHBOARD_CALLBACK_BASE_URL=${DASHBOARD_CALLBACK_BASE_URL:-${AURA_PROTO}://${AURA_HOST}}
poetry run ./manage.py migrate --no-input
poetry run ./manage.py collectstatic --no-input
poetry run ./manage.py createsuperuser --no-input
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
elif [ "$1" = "run.dev" ]; then
poetry run ./manage.py runserver 0.0.0.0:8000
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment