From d44adc957b54ff4024a941e5e77e3417cb2f549d Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Wed, 29 Apr 2015 14:50:44 +0000 Subject: [PATCH] Deployment script fixed! --- INSTALL.md | 4 +++- TODO.md | 1 + scripts/container/deploy.sh | 12 +++++++----- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 10ee038d..eb002af0 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -39,8 +39,10 @@ Django-orchestra can be installed on any Linux system, however it is **strongly 5. Create and configure a Postgres database ```bash sudo python3 manage.py setuppostgres --db_password - python3 manage.py syncdb + python3 manage.py migrate auth + python3 manage.py migrate accounts python3 manage.py migrate + python3 manage.py syncdb ``` 7. Configure celeryd diff --git a/TODO.md b/TODO.md index 3b030a97..56cc6562 100644 --- a/TODO.md +++ b/TODO.md @@ -256,6 +256,7 @@ https://code.djangoproject.com/ticket/24576 # migrations accounts, bill, orders, auth -> migrate the rest (contacts lambda error) + * MultiCHoiceField proper serialization * UNIFY PHP FPM settings name diff --git a/scripts/container/deploy.sh b/scripts/container/deploy.sh index 575190ca..1c84f903 100755 --- a/scripts/container/deploy.sh +++ b/scripts/container/deploy.sh @@ -78,10 +78,12 @@ if [[ ! $(sudo su postgres -c "psql -lqt" | awk {'print $1'} | grep '^orchestra$ sudo su postgres -c 'psql -c "ALTER USER orchestra CREATEDB;"' fi -run "$PYTHON_BIN $MANAGE syncdb --noinput" +run "$PYTHON_BIN $MANAGE migrate --noinput auth" +run "$PYTHON_BIN $MANAGE migrate --noinput accounts" run "$PYTHON_BIN $MANAGE migrate --noinput" +run "$PYTHON_BIN $MANAGE syncdb --noinput" -sudo python $MANAGE setupcelery --username $USER --processes 2 +sudo $PYTHON_BIN $MANAGE setupcelery --username $USER --processes 2 # Install and configure Nginx web server surun "mkdir -p $BASE_DIR/static" @@ -95,10 +97,10 @@ run "$PYTHON_BIN $MANAGE restartservices" # Create a orchestra user cat <<- EOF | $PYTHON_BIN $MANAGE shell -from orchestra.apps.accounts.models import Account +from orchestra.contrib.accounts.models import Account if not Account.objects.filter(username="$USER").exists(): - print 'Creating orchestra superuser' - __ = Account.objects.create_superuser("$USER", "$USER@localhost", "$PASSWORD") + print('Creating orchestra superuser') + Account.objects.create_superuser("$USER", "$USER@localhost", "$PASSWORD") EOF