-
-
Save bitprophet/35a3f04306f2f1be7f4f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fabric.api import env, run | |
def deploy(): | |
run("whatevs") | |
# 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): | |
env.update(environments[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