Created
February 28, 2013 09:23
-
-
Save oyakata/5055451 to your computer and use it in GitHub Desktop.
fabricのお役立ちコンテキストマネージャ ref: http://qiita.com/items/d848a7e0a6271baa722d
This file contains 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
import fabric.api as api | |
with api.env_shell("PYTHONPATH=. DJANGO_SETTINGS_MODULE=settings.imagawa"): | |
api.run("python dosomething.py") |
This file contains 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
import fabric.api as api | |
with api.prefix(". /home/www/bin/activate"): | |
fabric.api.run("./manage.py syncdb") |
This file contains 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
import fabric.api as api | |
with api.path("/usr/local/bin", behavior="prepend"): | |
api.run("python -V") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment