From e97ae69d3c720c83414692da360abe71781022f0 Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Tue, 5 May 2015 20:32:38 +0000 Subject: [PATCH] Fixes on deploy.sh --- scripts/container/deploy.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/container/deploy.sh b/scripts/container/deploy.sh index 334c6e96..9316bc56 100755 --- a/scripts/container/deploy.sh +++ b/scripts/container/deploy.sh @@ -85,16 +85,20 @@ if [[ ! $(sudo su postgres -c "psql -lqt" | awk {'print $1'} | grep '^orchestra$ sudo su postgres -c 'psql -c "ALTER USER orchestra CREATEDB;"' fi - # admin_tools needs accounts and does not have migrations -run "$PYTHON_BIN $MANAGE migrate --noinput accounts" -run "$PYTHON_BIN $MANAGE migrate --noinput" +if [[ ! $(sudo su postgres -c "psql orchestra -q -c 'SELECT * FROM accounts_account LIMIT 1;' 2> /dev/null") ]]; then + run "$PYTHON_BIN $MANAGE migrate --noinput accounts" + run "$PYTHON_BIN $MANAGE migrate --noinput" +else + $PYTHON_BIN $MANAGE postupgradeorchestra --from $CURRENT_VERSION +fi + if [[ $CELERY == true ]]; then run apt-get install -y rabbitmq sudo $PYTHON_BIN $MANAGE setupcelery --username $USER --processes 2 else - run "$PYTHON_BIN $MANAGE setupcronbeat" + surun "$PYTHON_BIN $MANAGE setupcronbeat" fi