Skip to content

Commit

Permalink
merge master -Dorg -Snone: PR 17 (Override omero.db.name (fix ome#16))
Browse files Browse the repository at this point in the history
  • Loading branch information
snoopycrimecop committed Feb 13, 2018
2 parents 93590a6 + 219a7a8 commit 20c8de8
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion 60-database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,19 @@ else
DBHOST=db
$omero config set omero.db.host "$DBHOST"
fi

CONFIG_omero_db_name=${CONFIG_omero_db_name:-}
if [ -n "$CONFIG_omero_db_name" ]; then
DBNAME="$CONFIG_omero_db_name"
DBNAME_src=env
else
# Delay setting in config until *after*
# the upgrade is attempted.
DBNAME=omero
DBNAME_src=default
fi

DBUSER="${CONFIG_omero_db_user:-omero}"
DBNAME="${CONFIG_omero_db_name:-omero}"
DBPASS="${CONFIG_omero_db_pass:-omero}"
ROOTPASS="${ROOTPASS:-omero}"

Expand All @@ -40,6 +51,9 @@ psql -w -h "$DBHOST" -U "$DBUSER" "$DBNAME" -c \
echo "Upgrading database"
$omego db upgrade --serverdir=OMERO.server
} || {
if [ "$DBNAME_src" = default ]; then
$omero config set omero.db.name "$DBNAME"
fi
echo "Initialising database"
$omego db init --rootpass "$ROOTPASS" --serverdir=OMERO.server
}

0 comments on commit 20c8de8

Please sign in to comment.