Home

fabulator

Fabulator provides a few fonctions, class, decorators and configuration to quickly write a fabfile.

Using mercurial, fabulator aims at deploying a django project onto your servers using fabric. For the moment, it supports debian (well, ubuntu), mysql, memcached, nginx, gunicorn.

You can specify a yaml configuration files depending on which kind of servers you're deploying your projects.

Examples

This, will install your project using fooproject.yaml. The install will clone your mercurial repos, create the database, install your vhost on nginx, restart nginx, restart memcached, start gunicorn.

$> fab prod:fooproject.yaml install

Here is the list of the supported tasks :

  • copy_vhost
  • delete_database
  • delete_repos
  • distro_
  • django_settings
  • install for the first install onto the machines
  • install_database
  • install_httpd_vhost
  • load_yaml
  • nginx_logs
  • preprod Preprod tasks
  • prod Prod tasks
  • pwd
  • reset
  • services_reload
  • services_restart
  • uname
  • update updates the code and everything else
  • update_database
  • update_hg
  • virtualenv
  • wsgi_restart

Configuration

I want the configuration file to be succint, and to have one file for one projet (with, "staging", "preprod" and "prod")

Here is an example :

--- #YAML:1.1


#can be "prod" or "preprod"
prod:
    distro:
        name: debian
        packages: [python-virtualenv, libmysqlclient15-dev]
    project:
        name: project_name
        normal_user: user
        sudo_user: sudo_user
        logs: project_name.log
        root_dir: /home/web/django/
        doc_root: /home/web/django/project_name/
    hosts:
        web: [inventeev.com]
    database:
        type: mysql
        host: 
        port: 
        user: 
        db: 
        pw: 
        backup: /path/to/database/backup
    hg:
        url: 
        repos: 
        dest: 
        user: 
        pw: 
    django:
        doc_root: /path/to/projet_root
        src_dir: /path/to/django/project/dir
        apps: [app,list]
    virtualenv:
        dir: /path/to/desired/folder/for/your/virtualenv
        bin_dir: /path/to/desired/folder/for/your/virtualenv/bin
        
    wsgi:
        type: gunicorn
        bin_name: gunicorn_django
        path: /path/to/desired/folder/for/your/virtualenv/bin
        pidfile: /where/to/store/your/pidfile
        logfile: /where/to/store/your/wsgi/logfile
        host: 127.0.0.1
        port: [9111]
        workers: 2
    httpd:
        type: nginx
        en: /etc/nginx/sites-enabled/
        av: /etc/nginx/sites-available/
        
    services:
        restart:
            [memcached]
        reload:
            [nginx]

Updated

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.