Skip to content

Instantly share code, notes, and snippets.

@chrislkeller
Created May 6, 2014 19:06
Show Gist options
  • Save chrislkeller/42273010b06eb097fc98 to your computer and use it in GitHub Desktop.
Save chrislkeller/42273010b06eb097fc98 to your computer and use it in GitHub Desktop.
webfaction-fabfile.py
from __future__ import with_statement
import os
import time, datetime
from fabric.operations import prompt
from fabric.api import *
from fabric.contrib.console import confirm
from fabric.colors import green
env.hosts = ['{{YOUR WEBFACTION PATH}}']
def commit(message='updates'):
try:
local('git add .')
local('git commit -m "' + message + '"')
local('git push')
print(green('Committed and pushed to git.', bold=False))
except:
print(green('Done committing, likely nothing new to commit.', bold=False))
def deploy():
code_dir = '{{YOUR CONTENT DIRECTORY}}'
with cd(code_dir):
run ('git pull')
def commit_deploy(message='updates'):
commit(message='No comment provided')
deploy()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment