Skip to content

Instantly share code, notes, and snippets.

@mzupan
Created May 29, 2013 15:53
Show Gist options
  • Save mzupan/5671386 to your computer and use it in GitHub Desktop.
Save mzupan/5671386 to your computer and use it in GitHub Desktop.
from fabric.api import *
@task
@runs_once
def prod():
env.roledefs['app'] = ['web1.sc', 'web2.sc', 'web3.sc', 'web4.sc']
env.roledefs['lb'] = ['lb1.sc', 'lb2.sc']
env.roledefs['sql'] = ['mysql1.sc', 'mysql2.sc']
@task
@runs_once
def stg():
env.roledefs['app'] = ['web1.stg', 'web2.stg']
env.roledefs['lb'] = ['lb1.stg']
env.roledefs['sql'] = ['mysql1.stg']
@task
@runs_once
def deploy():
for task in [web,sql]:
execute(task)
@roles('app')
def web():
run("hostname")
@roles('sql')
def sql():
run("hostname")
@gyndav
Copy link

gyndav commented Jul 25, 2013

What's your shell call ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment