-
-
Save pavelik/0a2aa52e34b2cca507a00dbc9b2c4f41 to your computer and use it in GitHub Desktop.
Revisions
-
twneale revised this gist
Oct 6, 2013 . 1 changed file with 3 additions and 0 deletions.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 @@ -1,3 +1,6 @@ '''See http://stackoverflow.com/a/5359988/120991 ''' from fabric.api import * from contextlib import contextmanager -
twneale created this gist
Oct 6, 2013 .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,23 @@ from fabric.api import * from contextlib import contextmanager env.update( use_ssh_config=True, directory='/home/ubuntu/projects/thingy', activate='source /home/ubuntu/.virtualenvs/thingy/bin/activate', ) @contextmanager def virtualenv(): '''Context manager to activate virtualenv. ''' with cd(env.directory): with prefix(env.activate): yield def supervisor(command, process): with virtualenv(): run('supervisor restart something')