Remove the --dbaction option from the deploy command.

This commit is contained in:
Antoine Nguyen
2015-02-03 09:00:10 +01:00
parent dd1035de73
commit 0b86a686aa
4 changed files with 12 additions and 22 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ Deploy an instance for development
Now that you have a :ref:`running environment <venv_for_dev>`, you're
ready to deploy a test instance::
$ modoboa-admin.py deploy --dbaction install --devel --dburl <database url> <path>
$ modoboa-admin.py deploy --devel --dburl <database url> <path>
$ cd <path>
$ python manage.py runserver
+1 -1
View File
@@ -94,7 +94,7 @@ Deployment
`modoboa-admin.py`, a command line tool, lets you deploy a
*ready-to-use* Modoboa site using only one instruction::
$ modoboa-admin.py deploy modoboa_example --dbaction install --collectstatic [--with-amavis] [--dburl database-url] [--amavis_dburl database-url]
$ modoboa-admin.py deploy modoboa_example --collectstatic [--with-amavis] [--dburl database-url] [--amavis_dburl database-url]
Just answer the few questions and you're done. You can now go to the
:ref:`first_use` section.
+1 -1
View File
@@ -35,7 +35,7 @@ your instance was first deployed::
Then, run ``modoboa-admin.py deploy``::
$ modoboa-admin.py deploy <modoboa_instance_dir> --dbaction upgrade --collectstatic [--with-amavis] [--dburl database-url] [--amavis_dburl database-url] [--domain hostname] [--lang lang] [--timezone timezone]
$ modoboa-admin.py deploy <modoboa_instance_dir> --collectstatic [--with-amavis] [--dburl database-url] [--amavis_dburl database-url] [--domain hostname] [--lang lang] [--timezone timezone]
If you prefer the manual way, check if
:ref:`specific_upgrade_instructions` are required according to the
+9 -19
View File
@@ -1,4 +1,7 @@
# coding: utf-8
"""A shortcut to deploy a fresh modoboa instance."""
import getpass
import os
import shutil
@@ -12,7 +15,6 @@ from django.template import Context, Template
import dj_database_url
from modoboa.lib.sysutils import exec_cmd
from modoboa.core.commands import Command
DBCONN_TPL = """
@@ -47,10 +49,6 @@ class DeployCommand(Command):
'--with-amavis', action='store_true', default=False,
help='Include amavis configuration'
)
self._parser.add_argument(
'--dbaction', type=str, default="install",
help='Action to take on the database (install|upgrade)'
)
self._parser.add_argument(
'--collectstatic', action='store_true', default=False,
help='Run django collectstatic command'
@@ -215,24 +213,16 @@ class DeployCommand(Command):
os.mkdir("%s/media" % parsed_args.name)
os.unlink("%s/settings.pyc" % path)
if parsed_args.dbaction == "install":
self._exec_django_command(
"migrate", parsed_args.name, '--noinput'
)
self._exec_django_command(
"load_initial_data", parsed_args.name
)
elif parsed_args.dbaction == "upgrade":
exec_cmd('sed -ri "s|^#(\s+\'south)|\\1|" %s/settings.py' % path)
self._exec_django_command(
"syncdb", parsed_args.name, "--migrate"
)
self._exec_django_command(
"migrate", parsed_args.name, '--noinput'
)
self._exec_django_command(
"load_initial_data", parsed_args.name
)
if parsed_args.collectstatic:
self._exec_django_command(
"collectstatic", parsed_args.name, '--noinput'
)
self._exec_django_command(
"set_default_site", parsed_args.name, allowed_host
)