Skip to content

Instantly share code, notes, and snippets.

@hzbd
Forked from sapegin/fabfile.py
Created April 23, 2013 17:40
Show Gist options
  • Save hzbd/5445719 to your computer and use it in GitHub Desktop.
Save hzbd/5445719 to your computer and use it in GitHub Desktop.
from __future__ import with_statement
from fabric.api import *
from fabric.contrib.files import exists
env.use_ssh_config = True
env.hosts = ['locum']
REPO = 'git@bitbucket.org:sapegin/grunt-talk.git'
DEST = 'projects/sapegin/htdocs/subprojects/pres/grunt'
@task(default=True)
def deploy():
if exists(DEST):
with cd(DEST):
run('git checkout master')
run('git pull')
else:
run('git clone %s %s' % (REPO, DEST))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment