fab-user
[Top][All Lists]
Advanced

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

[Fab-user] Execute the same tasks in local() and run()


From: Jorge Vargas
Subject: [Fab-user] Execute the same tasks in local() and run()
Date: Thu, 12 Jul 2012 04:05:07 -0400

Hello,

We are using fabric for development as well as deployment and I'm wondering how people are doing command like this.

@task
def load_fixtures():
    """Load initial data."""
    run("venv/bin/python data/fixtures.py")

This code should work for both the developer machine (ie: run local) and the deployment machine (ie: use run)

So far what I have done is something like

@task
def install_db(command=local):
    """@onetime install of the database"""
    with prefix("source venv/bin/activate"):
        command("python manage.py syncdb --migrate")

However that's a bit of a problem as I can't call that command from fab just from other fabric scripts.

reply via email to

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