Instantly share code, notes, and snippets.

@bitprophet / Secret
Created Feb 23, 2012

What would you like to do?
from fabric.api import env, run
def deploy():
# Old way
def live():
env.hosts = ['a', 'b', 'c']
def staging():
env.hosts = ['1', '2']
# invoked as: fab live deploy
# New way
environments = {
'live': {'hosts': ['a', 'b', 'c']},
'staging': {'hosts': ['1', '2']}
def environment(name):
# invoked as: fab environment:live deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment