Skip to content

Instantly share code, notes, and snippets.

@sapegin
Created November 26, 2012 06:03
Show Gist options
  • Save sapegin/4146792 to your computer and use it in GitHub Desktop.
Save sapegin/4146792 to your computer and use it in GitHub Desktop.
Deploy via BitBucket repo using Fabric
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