Created
September 21, 2011 22:35
-
-
Save soyrex/1233517 to your computer and use it in GitHub Desktop.
simple fab template for restarting remote django site
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
from fabric.context_managers import cd | |
from fabric.operations import sudo,run,local | |
from fabric.state import env | |
env.hosts = ['127.0.0.1',] | |
env.user = 'username' | |
env.deploy_user = 'django' | |
env.key_filename = ['/Users/soyrex/Keys/keyfile.pem',] | |
def stage(): | |
local('git push origin staging') | |
with cd('/path/to/git/clone'): | |
sudo('git pull origin staging',user=env.deploy_user) | |
sudo('/etc/init.d/django-fcgi restart',user='root') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment