Skip to content
Snippets Groups Projects
Commit 1c0e48e2 authored by Roman Brendler's avatar Roman Brendler
Browse files

feat(setup):Add initial db setup script for use with docker-compose

parent 161db8bb
No related branches found
No related tags found
No related merge requests found
Pipeline #1591 failed
...@@ -18,7 +18,7 @@ docker="false" ...@@ -18,7 +18,7 @@ docker="false"
# - docker:dev # - docker:dev
# #
if [[ $* =~ ^(init|dev|prod|test|build|push|serve)$ ]]; then if [[ $* =~ ^(init|init-db|dev|prod|test|build|push|serve)$ ]]; then
mode=$1 mode=$1
fi fi
...@@ -37,6 +37,19 @@ echo "[ Docker=$docker ]" ...@@ -37,6 +37,19 @@ echo "[ Docker=$docker ]"
if [[ $docker == "false" ]]; then if [[ $docker == "false" ]]; then
if [[ $mode == "init-db" ]]; then
echo "apply database migrations"
./manage.py migrate
echo "create django superuser"
./manage.py createsuperuser --noinput
echo "create rsa key"
./manage.py creatersakey
echo "create dashboard client with client id $DASHBOARD_OIDC_CLIENT_ID"
./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}
echo "create tank client with client id $TANK_OIDC_CLIENT_ID"
./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}/auth/oidc/callback
fi
### Initializes the project (Development) ### ### Initializes the project (Development) ###
if [[ $mode == "init" ]]; then if [[ $mode == "init" ]]; then
......
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