Skip to content

Instantly share code, notes, and snippets.

Created August 24, 2011 00:57
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save justinvoss/1167048 to your computer and use it in GitHub Desktop.
from fabric.api import settings, roles, env, run, sudo, cd
from fabric.decorators import task
from fabric import tasks
from fabric.contrib.project import rsync_project
env.roledefs = {
'dev': [
'prod': [
class DemoDeployment(tasks.Task):
name = 'deploy'
def run(self):
run('coffee -c /srv/fabric-demo/src/js/')
sudo('service nginx reload')
def refresh_code(self):
remote_dir = '/srv/fabric-demo',
local_dir = './',
delete = True,
exclude = ['*.pyc', '', '.vagrant', 'Vagrantfile'],
class DemoProductionDeployment(DemoDeployment):
name = 'production_deploy'
def refresh_code(self):
with cd('/srv/fabric-demo/'):
run('git checkout -- .')
run('git pull')
def deploy():
env.key_filename = '/Library/Ruby/Gems/1.8/gems/vagrant-0.8.2/keys/vagrant'
t = DemoDeployment()
def production_deploy():
t = DemoProductionDeployment()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment