Created
May 29, 2013 15:53
-
-
Save mzupan/5671386 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 * | |
@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") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What's your shell call ?