mirror of
https://github.com/zulip/docker-zulip.git
synced 2025-11-06 15:03:14 +00:00
Always call initialize-database script because it inserts required data
This commit is contained in:
@@ -48,7 +48,6 @@ ZULIP_CERTIFICATE_CN="${ZULIP_CERTIFICATE_CN:-}"
|
|||||||
ZULIP_AUTH_BACKENDS="${ZULIP_AUTH_BACKENDS:-EmailAuthBackend}"
|
ZULIP_AUTH_BACKENDS="${ZULIP_AUTH_BACKENDS:-EmailAuthBackend}"
|
||||||
ZULIP_RUN_POST_SETUP_SCRIPTS="${ZULIP_RUN_POST_SETUP_SCRIPTS:-True}"
|
ZULIP_RUN_POST_SETUP_SCRIPTS="${ZULIP_RUN_POST_SETUP_SCRIPTS:-True}"
|
||||||
# Zulip user setup
|
# Zulip user setup
|
||||||
FORCE_FIRST_START_INIT="${FORCE_FIRST_START_INIT:-False}"
|
|
||||||
export ZULIP_USER_CREATION_ENABLED="${ZULIP_USER_CREATION_ENABLED:-True}"
|
export ZULIP_USER_CREATION_ENABLED="${ZULIP_USER_CREATION_ENABLED:-True}"
|
||||||
export ZULIP_USER_FULLNAME="${ZULIP_USER_FULLNAME:-Zulip Docker}"
|
export ZULIP_USER_FULLNAME="${ZULIP_USER_FULLNAME:-Zulip Docker}"
|
||||||
export ZULIP_USER_DOMAIN="${ZULIP_USER_DOMAIN:-$(echo $SETTING_EXTERNAL_HOST)}"
|
export ZULIP_USER_DOMAIN="${ZULIP_USER_DOMAIN:-$(echo $SETTING_EXTERNAL_HOST)}"
|
||||||
@@ -420,28 +419,10 @@ userCreationConfiguration() {
|
|||||||
fi
|
fi
|
||||||
echo "Zulip user creation left enabled."
|
echo "Zulip user creation left enabled."
|
||||||
}
|
}
|
||||||
zulipFirstStartInit() {
|
|
||||||
echo "Executing Zulip first start init ..."
|
|
||||||
if ([ "$FORCE_FIRST_START_INIT" != "True" ] && [ "$FORCE_FIRST_START_INIT" != "true" ]) && [ -e "$DATA_DIR/.initiated" ]; then
|
|
||||||
echo "First Start Init not needed. Continuing."
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
local RETURN_CODE=0
|
|
||||||
set +e
|
|
||||||
su zulip -c /home/zulip/deployments/current/scripts/setup/initialize-database
|
|
||||||
RETURN_CODE=$?
|
|
||||||
if [[ $RETURN_CODE != 0 ]]; then
|
|
||||||
echo "Zulip first start database initi failed in \"initialize-database\" exit code $RETURN_CODE. Exiting."
|
|
||||||
exit $RETURN_CODE
|
|
||||||
fi
|
|
||||||
set -e
|
|
||||||
touch "$DATA_DIR/.initiated"
|
|
||||||
echo "Zulip first start init sucessful."
|
|
||||||
}
|
|
||||||
zulipMigration() {
|
zulipMigration() {
|
||||||
echo "Migrating Zulip to new version ..."
|
echo "Migrating Zulip to new version ..."
|
||||||
set +e
|
set +e
|
||||||
su zulip -c "/home/zulip/deployments/current/manage.py migrate --noinput"
|
su zulip -c /home/zulip/deployments/current/scripts/setup/initialize-database
|
||||||
local RETURN_CODE=$?
|
local RETURN_CODE=$?
|
||||||
if [[ $RETURN_CODE != 0 ]]; then
|
if [[ $RETURN_CODE != 0 ]]; then
|
||||||
echo "Zulip migration failed with exit code $RETURN_CODE. Exiting."
|
echo "Zulip migration failed with exit code $RETURN_CODE. Exiting."
|
||||||
@@ -486,7 +467,6 @@ bootstrappingEnvironment() {
|
|||||||
bootstrapDatabase
|
bootstrapDatabase
|
||||||
bootstrapRabbitMQ
|
bootstrapRabbitMQ
|
||||||
userCreationConfiguration
|
userCreationConfiguration
|
||||||
zulipFirstStartInit
|
|
||||||
zulipMigration
|
zulipMigration
|
||||||
runPostSetupScripts
|
runPostSetupScripts
|
||||||
echo "=== End Bootstrap Phase ==="
|
echo "=== End Bootstrap Phase ==="
|
||||||
|
|||||||
Reference in New Issue
Block a user