fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Fab-user] Can Fabric have (simple) multi-server wrapper tasks?


From: Daniel Craig
Subject: RE: [Fab-user] Can Fabric have (simple) multi-server wrapper tasks?
Date: Wed, 2 Feb 2011 12:57:20 -0500

I think what Carlton is looking for is a little different, though I do like 
your method.   I think I have the same needs as Carlton.  Likewise, I'm running 
a Django project with multiple servers acting in different roles.  Fabric's 
roles are great to handle that.  So I currently have something like this:

def production():
        env.roledefs['httpd'] = 'mywebserver.example.com'
        env.roledefs['db'] = 'mydbserver.example.com'
        env.roledefs['otherservices'] = 'otherservices.example.com'

@roles(['httpd'])
def update_django_project():
        run('my_update_routine...')

@roles(['db'])
def update_db():
        run('my_db_actions...')

@roles(['otherservices'])
def update_services():
        run('my_services_stuff...')


Right now, I have to run these sequentially from the command prompt, since the 
decorators don't seem to work within another method.

$ fab production update_django_project
$ fab production update_db
$ fab production update_services

What I'd love, and I suspect Carlton would as well, is the ability to wrap all 
those up in a single function

def deploy():
        update_django_project()
        update_db()
        update_services()

And thus be able to deploy with one line

$ fab production deploy

- Dan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]