Fixes on deploy.sh

This commit is contained in:
Marc Aymerich 2015-05-05 20:32:38 +00:00
parent ce42242cb0
commit e97ae69d3c
1 changed files with 8 additions and 4 deletions

View File

@ -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;"' sudo su postgres -c 'psql -c "ALTER USER orchestra CREATEDB;"'
fi fi
# admin_tools needs accounts and does not have migrations # admin_tools needs accounts and does not have migrations
run "$PYTHON_BIN $MANAGE migrate --noinput accounts" 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" 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 if [[ $CELERY == true ]]; then
run apt-get install -y rabbitmq run apt-get install -y rabbitmq
sudo $PYTHON_BIN $MANAGE setupcelery --username $USER --processes 2 sudo $PYTHON_BIN $MANAGE setupcelery --username $USER --processes 2
else else
run "$PYTHON_BIN $MANAGE setupcronbeat" surun "$PYTHON_BIN $MANAGE setupcronbeat"
fi fi