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