Skip to content

Instantly share code, notes, and snippets.

@hassek
Forked from anonymous/fabfile_demo.py
Created July 15, 2012 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hassek/3118567 to your computer and use it in GitHub Desktop.
Save hassek/3118567 to your computer and use it in GitHub Desktop.
FabFile
#To be able to use this, please do a symbolic link into project root:
#cd yourproject
#ln -s environments/my_own_fabfile.py fabfile.py
from fabric.api import env, local, run, cd, sudo
from fabric.decorators import hosts
env.project_root = '~/WebSites/PROJECT'
#from fabric.contrib import django
env.user = "USER"
env.password = "PASSWORD"
web1 = "PATH"
#def get_messages():
#with prefix('workon XXXX'):
##django.project('XXXX')
#django.settings_module('settings')
@hosts(web1)
def up_st():
with cd("PATH"):
local("git push origin staging")
run("git pull origin staging")
sudo("/etc/init.d/apache2 restart")
local("git pull origin staging")
local("git push origin staging")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment