Created
July 7, 2015 16:34
-
-
Save nheath/ee6aaa509b44e7909c96 to your computer and use it in GitHub Desktop.
Revisions
-
Nick Heath created this gist
Jul 7, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ @task(default=True) def deploy(source): execute('unique_id') dest = '/opt/app/{0}'.format(env['unique_id']) # both of these tasks are decorated with @parallel execute('sync', source=source, dest='~/app') execute('install', source="~/app", dest=dest) # apply following steps serially to each env.host host = env.host meta = get_metadata('ip', host) execute('elb_remove', hosts=host, region=meta['region'], instanceid=meta['id']) execute('deploy_symlink', hosts=host, source=dest, target='/opt/app') execute('service_restart', hosts=host, service="app") execute('elb_add', hosts=host, region=meta['region'], instanceid=meta['id'])