Sharing a fabfile across multiple projects
Posted
by Matthew Rankin
on Stack Overflow
See other posts from Stack Overflow
or by Matthew Rankin
Published on 2010-03-31T14:54:53Z
Indexed on
2010/04/01
13:03 UTC
Read the original article
Hit count: 196
Fabric has become my deployment tool of choice both for deploying Django projects and for initially configuring Ubuntu slices. However, my current workflow with Fabric isn't very DRY, as I find myself:
- copying the
fabfile.py
from one Django project to another and - modifying the
fabfile.py
as needed for each project (e.g., changing thewebserver_restart
task from Apache to Nginx, configuring the host and SSH port, etc.).
One advantage of this workflow is that the fabfile.py
becomes part of my Git repository, so between the fabfile.py
and the pip requirements.txt
, I have a recreateable virtualenv and deployment process. I want to keep this advantage, while becoming more DRY. It seems that I could improve my workflow by:
- being able to
pip install
the common tasks defined in thefabfile.py
and - having a
fab_config
file containing the host configuration information for each project and overriding any tasks as needed
Any recommendations on how to increase the DRYness of my Fabric workflow?
© Stack Overflow or respective owner