mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Remove the --dbaction option from the deploy command.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user