From 4fd3fdc66419bd797dc7efef7bc8d4c4a644b63b Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Fri, 2 Oct 2015 11:20:52 +0000 Subject: [PATCH] Fixes on deployment --- INSTALL.md | 2 +- orchestra/management/commands/setuppostgres.py | 3 ++- scripts/containers/deploy.sh | 10 +++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 5ad2de65..e96d5131 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -54,7 +54,7 @@ Django-orchestra can be installed on any Linux system, however it is **strongly 2. Use celeryd ```bash - sudo apt-get install rabbitmq + sudo apt-get install rabbitmq-server sudo python3 manage.py setupcelery --username orchestra ``` diff --git a/orchestra/management/commands/setuppostgres.py b/orchestra/management/commands/setuppostgres.py index 799c0a91..edb352cd 100644 --- a/orchestra/management/commands/setuppostgres.py +++ b/orchestra/management/commands/setuppostgres.py @@ -84,7 +84,8 @@ class Command(BaseCommand): raise CommandError("Postgres user '%(db_user)s' already exists and " "--db_pass has not been provided." % context) else: - msg = "Created new Postgres user '%(db_user)s' with password '%(default_db_password)s'" + context['db_password'] = context['default_db_password'] + msg = "Created new Postgres user '%(db_user)s' with password '%(db_password)s'" self.stdout.write(msg % context) self.run_postgres(create_database % context, valid_codes=(0,1)) diff --git a/scripts/containers/deploy.sh b/scripts/containers/deploy.sh index 96074d77..5bdda79a 100644 --- a/scripts/containers/deploy.sh +++ b/scripts/containers/deploy.sh @@ -43,7 +43,7 @@ function main () { read -p "Do you want to use celery or cronbeat (orchestra.contrib.tasks) for task execution [cronbeat]? " task case $task in 'celery' ) task=celery; break;; - 'orchestra.contrib.tasks' ) task=orchestra.contrib.tasks; break;; + 'cronbeat' ) task=orchestra.contrib.tasks; break;; '' ) task=orchestra.contrib.tasks; break;; * ) echo "Please answer celery or cronbeat.";; esac @@ -63,12 +63,12 @@ function main () { run python3 -W ignore manage.py migrate - if [[ "$task" == "cronbeat" ]]; then + if [[ "$task" == "celery" ]]; then + run sudo apt-get install rabbitmq-server + run sudo python3 -W ignore manage.py setupcelery --username $USER + else run python3 -W ignore manage.py setupcronbeat run python3 -W ignore manage.py syncperiodictasks - else - run sudo apt-get install rabbitmq - run sudo python3 -W ignore manage.py setupcelery --username $USER fi run sudo python3 -W ignore manage.py setuplog --noinput