Deployment script fixed!

This commit is contained in:
Marc Aymerich 2015-04-29 14:50:44 +00:00
parent 14d0507061
commit d44adc957b
3 changed files with 11 additions and 6 deletions

View File

@ -39,8 +39,10 @@ Django-orchestra can be installed on any Linux system, however it is **strongly
5. Create and configure a Postgres database 5. Create and configure a Postgres database
```bash ```bash
sudo python3 manage.py setuppostgres --db_password <password> sudo python3 manage.py setuppostgres --db_password <password>
python3 manage.py syncdb python3 manage.py migrate auth
python3 manage.py migrate accounts
python3 manage.py migrate python3 manage.py migrate
python3 manage.py syncdb
``` ```
7. Configure celeryd 7. Configure celeryd

View File

@ -256,6 +256,7 @@ https://code.djangoproject.com/ticket/24576
# migrations accounts, bill, orders, auth -> migrate the rest (contacts lambda error) # migrations accounts, bill, orders, auth -> migrate the rest (contacts lambda error)
* MultiCHoiceField proper serialization * MultiCHoiceField proper serialization
* UNIFY PHP FPM settings name * UNIFY PHP FPM settings name

View File

@ -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;"' sudo su postgres -c 'psql -c "ALTER USER orchestra CREATEDB;"'
fi 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 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 # Install and configure Nginx web server
surun "mkdir -p $BASE_DIR/static" surun "mkdir -p $BASE_DIR/static"
@ -95,10 +97,10 @@ run "$PYTHON_BIN $MANAGE restartservices"
# Create a orchestra user # Create a orchestra user
cat <<- EOF | $PYTHON_BIN $MANAGE shell 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(): if not Account.objects.filter(username="$USER").exists():
print 'Creating orchestra superuser' print('Creating orchestra superuser')
__ = Account.objects.create_superuser("$USER", "$USER@localhost", "$PASSWORD") Account.objects.create_superuser("$USER", "$USER@localhost", "$PASSWORD")
EOF EOF