installer: Do not initialize db with --no-init-db.

The `--no-init-db` option previously only controlled if
`initialize-database` was run, which sets up the tables inside the
database.  If PostgreSQL was installed locally, it still attempted to
create the user and empty database.

This fails on hosts which are remote PostgreSQL hosts, and not
application hosts, as:

 - They may already have a local database, and while
 `initialize-datbase` will detect and offer to abort if one is
 found,`--no-init-db` seems like it should be the option to not
 overwrite it

 - `flush-memcached` requires that a local venv be installed, which it
 often is not on non-frontend machines.

Skip the database configuration when run with `--no-init-db`.
This commit is contained in:
Alex Vandiver 2020-06-17 14:27:51 -07:00 committed by Tim Abbott
parent 48719cb8c4
commit 5b7be7ba5d
1 changed files with 1 additions and 1 deletions

View File

@ -402,7 +402,7 @@ EOF
"$ZULIP_PATH"/scripts/setup/configure-rabbitmq
fi
if [ "$has_postgres" = 0 ]; then
if [ "$has_postgres" = 0 ] && [ -z "$NO_INIT_DB" ]; then
"$ZULIP_PATH"/scripts/setup/postgres-init-db
fi