Commits

theoden committed 034323c

doc: user guide changes.

  • Participants
  • Parent commits 158f993
  • Branches multiple web-servers

Comments (0)

Files changed (1)

File docs/guide.rst

 
         # my_project/fabfile.py
         from fabric.api import env, task
+
+        from fab_deploy.project import WebProject
         from fab_deploy.utils import update_env
+        from fab_deploy.django import Django
+        from fab_deploy.webserver.apache import Apache
+        from fab_deploy.webserver.nginx import Nginx
+
+        apps = dict(django=Django(Nginx(), Apache()))
+        WebProject(apps=apps).expose_to_current_module()
 
         @task
         def my_site():
 
         my_site()
 
-   There is a simpler syntax for the code above::
+   ``apps`` dictionary is provided with default values for WebProject. Yes, 
+   that is a fallback to previous versions of django-fab-deploy. And 
+   there is a simpler syntax for the code above::
 
+        from fab_deploy.project import WebProject
         from fab_deploy.utils import define_host
 
+        WebProject().expose_to_current_module()
+
         @define_host('my_site@example.com')
         def my_site():
             return dict(
        after initial deployment, apply the changes in web server configs
        by running ::
 
-           fab setup_web_server
+           fab update_web_servers
+
+       It will update all remote configs of all apps of your default project.
 
 
 4. Create :file:`config.server.py` near your project's ``settings.py``.
        after initial deployment, apply the changes to :file:`config.server.py`
        by running ::
 
-           fab update_django_config
+           fab apps.django.update_config
 
+       for default apps configuration. Or more generic ::
+
+           fab apps.{{ django_app_name }}.update_config
 
 5. Create ``reqs`` folder at project root. This folder should contain
    text files with `pip requirements <http://pip.openplans.org/requirement-format.html>`_.
             ...          <- you can provide extra files and include them with '-r' syntax in e.g. all.txt
 
         config.py        <- this file should be included in settings.py and ignored in .hgignore
-        config.server.py <- this is a production django config template
+        config.server.py <- this is a production django config template (should be ignored too!)
         fabfile.py       <- your project's Fabric deployment script
         settings.py
         manage.py
 1. If the server doesn't have sudo installed (e.g. clean Lenny or Squeezy)
    then install sudo on server::
 
-       fab install_sudo
+       fab system.install_sudo
 
    .. note::
 
 
    ::
 
-       fab create_linux_account:"/home/kmike/.ssh/id_rsa.pub"
+       fab system.create_linux_account:"/home/kmike/.ssh/id_rsa.pub"
 
    You'll need the ssh public key.
    :func:`create_linux_account <fab_deploy.system.create_linux_account>`
 
    SSH keys for other developers can be added at any time::
 
-       fab ssh_add_key:"/home/kmike/coworker-keys/ivan.id_dsa.pub"
+       fab system.ssh_add_key:"/home/kmike/coworker-keys/ivan.id_dsa.pub"
 
 3. Setup the database. django-fab-deploy can install mysql and create empty
    DB for the project (using defaults in your default host function)::
 
-       fab mysql.install
-       fab mysql.create_db
+       fab db.mysql.install
+       fab db.mysql.create_db
 
    :func:`mysql.install <fab_deploy.db.mysql.install>` does
    nothing if mysql is already installed on server. Otherwise it installs
 
    .. note::
 
-        If the DB enging is not mysql then use appropriate commands.
+        If the DB engine is not mysql then use appropriate commands.
 
 
 4. If you feel brave you can now run ``fab full_deploy`` from the project root
    ``fab full_deploy`` command:
 
    * installs necessary system and python packages;
-   * configures apache and ngnix;
+   * configures web-servers for all applications of your project;
    * creates virtualenv;
    * uploads project to the server;
    * runs ``python manage.py syncdb`` and ``python manage.py migrate`` commands
 
        fab prod push:pip_update,migrate
 
-2. Update web server configuration::
+2. Update web servers configuration::
 
-       fab setup_web_server
+       fab update_web_servers
 
-3. Update django configuration (:file:`config.server.py`)::
+3. Update some app configuration (:file:`config.server.py` for django 
+   or :file:`production.ini` for pyramid)::
 
-       fab update_django_config
+       fab apps.{{ app_name }}.update_config
+
+   where ``app_name`` actually is a key in apps dictionary.
 
 4. Requirements are updated with :func:`fab_deploy.virtualenv.pip_update`
    command. Update requirements listed in reqs/active.txt::
 
-       fab pip_update
+       fab update_r
 
    Update requirements listed in reqs/my_apps.txt::
 
-       fab pip_update:my_apps
+       fab update_r:my_apps
 
 5. Remotely change branch or revision (assuming :attr:`env.conf.VCS`
    is not 'none')::