skip to navigation
skip to content

easyfab 0.4.0

Simple deployments with fabric

Latest Version: 0.4.21

Small wrapper around fabric. This package is just a small project to have deployments right from the start of development. It supports some callbacks so you can bring your own functionality. Currently easyfab supports:

  • Virtualenv
  • Upgrade virtualenv on remote servers according to machine on which is project deployed
  • Multiple commands (django manage command, make_package, deploy)
  • packages are created to deployment/.packages directory so you will have history

Easyfab still under heavy development but api of custom Deployment will not be changed, only added new functionality (new easyfabtasks).


easyfab needs virtualenv to work correctly on the remote server so please start using it. For python programmers it’s second best thing since sliced bread.


via pip:

$ pip install easyfab

or if you want latest version from repository, clone repository and run:

$ python install


in project top level directory simply run:

$ easyfab init

Easyfab will generate which acts as proxy to easyfab. No need to edit it in the future. Then if you want to add new deployment (in this case settings for production server):

$ easyfab add production

Now we can edit production deployment in deployment/ . easyfab makes some sane defaults but there will be needed some changes. Also there is directory deployment/production, where are generated skeleton configurations for nginx, supervisor (more to come)

then you can simply run:

$ fab use:production easyfab:deploy

and project will be deployed (nice huh?)

Built in commands

Easyfab in current state provides this commands





More commands will come in future versions.

Custom commands

Every method on Deployment class which is decorated with @easyfabtask is task and can be called from command line:

$ fab use:production easyfab:my_custom_task

Also it supports arguments and keyword arguments (fabric does) so you can call:

$ fab use:production easyfab:my_custom_task,argument1,argument2

Sources are templates

Files with extensions defined in Deployment.processed_extensions will be run through templating system (jinja2) with data context given in get_context_data method. If you want you can add custom data override Deployment.get_context_data add custom data you want to use in your source files and you are ready to go.

for example:

def get_context_data(self, **kwargs):
    kwargs['version'] = '1.2.3b'
    super(Deployment, self).get_context_data(**kwargs)

Then simply you can add to your files {< version >} and you’re done. Template engine start and end tags are {< variable >} so it won’t collide with your template engine.

Items and get_item method

The most used method in Deployment class will be get_items. These method should return list of items which easyfab will process. Available items are


this item creates directory. Arguments are

directory_name - if this is absolute path it will be added to package_root directory

e.g. /var/log/my_awesome_app will be added here .packaging/app-master/var/log/my_awesome_app


this item copies directory tree. Arguments are

src - source. In case of relative path it will be used as child to project_dir

destination - In case of relative path it will be used as child to package_project_dir


this item makes symlinks. Arguments are

src - source (existing file), If it’s relative path, it will be a child to target_dir

destination - symlink location, If it’s relative path it will be a child to package_project_dir otherwise it will be child to package_root


In case of any custom processing to package source files, you can use multiple callbacks


This callback will be called before make package is run, argument is context dictionary with all needed paths. You can run here e.g. compilemessages, collectstatic


This callback will be called after make package is run (but before actual gzipping), argument is context dictionary with all needed paths. You can run here commands that will process all copied files e.g. compression of javascript, css, etc..

Have phun.

File Type Py Version Uploaded on Size
easyfab-0.4.0.tar.gz (md5) Source 2014-03-25 10KB
  • Author: phonkee
  • Home Page:
  • License:
    Copyright 2013 Peter Vrba
       Licensed under the Apache License, Version 2.0 (the "License");
       you may not use this file except in compliance with the License.
       You may obtain a copy of the License at
       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.
  • Package Index Owner: phonkee
  • DOAP record: easyfab-0.4.0.xml