Skip to content

Instantly share code, notes, and snippets.

@maximebf maximebf/
Created Feb 5, 2012

What would you like to do?
Fabfile to deploy a jekyll site
from fabric.api import task, run, env, execute, local, put, lcd
env.site_path = '/tmp/jekyll-site'
env.tar_filename = env.site_path + '.tar.bz2'
env.remote_site_path = '~/public_html'
def build():
local("jekyll %s" % env.site_path)
with lcd(env.site_path):
local('tar cjf %s *' % env.tar_filename)
local("rm -r %s" % env.site_path)
def push():
run('mkdir -p %s' % env.remote_site_path)
put(env.tar_filename, env.tar_filename)
run('tar xjf %s -C %s' % (env.tar_filename, env.remote_site_path))
run('rm %s' % env.tar_filename)
def deploy():
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.