Skip to content

Instantly share code, notes, and snippets.

@mgedmin
Last active September 6, 2019 05:59
Show Gist options
  • Save mgedmin/e9864045697c37d9722f to your computer and use it in GitHub Desktop.
Save mgedmin/e9864045697c37d9722f to your computer and use it in GitHub Desktop.
Example of multiple environments in Fabric 1.x
from fabric.api import env, task, sudo
@task
def staging():
env.hosts.append('staging.example.com')
@task
def production():
env.hosts.append('production.example.com')
@task
def restart():
sudo('service myapp restart')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment