From 13307adbcdf58fc309e5edccc2154c09d4e6d82d Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Fri, 2 Oct 2015 13:01:01 +0000 Subject: [PATCH] Fixes on deployment --- orchestra/management/commands/setuppostgres.py | 2 +- scripts/containers/deploy.sh | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/orchestra/management/commands/setuppostgres.py b/orchestra/management/commands/setuppostgres.py index ec0d1dc7..df94895e 100644 --- a/orchestra/management/commands/setuppostgres.py +++ b/orchestra/management/commands/setuppostgres.py @@ -3,7 +3,7 @@ import textwrap from optparse import make_option from django.conf import settings -from django.core.management.base import BaseCommand +from django.core.management.base import BaseCommand, CommandError from orchestra.utils.paths import get_project_dir from orchestra.utils.python import random_ascii diff --git a/scripts/containers/deploy.sh b/scripts/containers/deploy.sh index 5e1b4e9f..5b372131 100644 --- a/scripts/containers/deploy.sh +++ b/scripts/containers/deploy.sh @@ -111,8 +111,12 @@ function main () { cd $project_name run sudo service postgresql start - run sudo python3 -W ignore manage.py setuppostgres $noinput - + if [[ $noinput == '--noinput' ]]; then + db_password=$(ps aux | sha256sum | base64 | head -c 10) + run sudo python3 -W ignore manage.py setuppostgres --noinput --db_password $db_password + else + run sudo python3 -W ignore manage.py setuppostgres + fi surun "python3 -W ignore manage.py migrate $noinput" if [[ $noinput == '--noinput' ]]; then # Create orchestra superuser