already_configured flag for checking db init
This commit is contained in:
parent
e1c26db29f
commit
bb2972f672
|
@ -28,14 +28,11 @@ END
|
|||
}
|
||||
|
||||
deployment_strategy() {
|
||||
# detect if existing deployment (TODO only works with sqlite)
|
||||
if [ -f "${idhub_dir}/db.sqlite3" ]; then
|
||||
echo "INFO: detected EXISTING deployment"
|
||||
./manage.py migrate
|
||||
|
||||
# warn admin that it should re-enter password to keep the service working
|
||||
./manage.py send_mail_admins
|
||||
else
|
||||
init_flagfile="${idhub_dir}/already_configured"
|
||||
if [ ! -f "${init_flagfile}" ]; then
|
||||
|
||||
echo "INFO: detected NEW deployment"
|
||||
# this file helps all docker containers to guess number of hosts involved
|
||||
# right now is only needed by new deployment for oidc
|
||||
if [ -d "/sharedsecret" ]; then
|
||||
|
@ -58,6 +55,15 @@ deployment_strategy() {
|
|||
else
|
||||
echo "Note: skipping oidc4vp config"
|
||||
fi
|
||||
|
||||
# remain next command as the last operation for this if conditional
|
||||
touch "${init_flagfile}"
|
||||
|
||||
else
|
||||
echo "INFO: detected PREVIOUS deployment"
|
||||
./manage.py migrate
|
||||
# warn admin that it should re-enter password to keep the service working
|
||||
./manage.py send_mail_admins
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue