Created
May 6, 2014 19:06
-
-
Save chrislkeller/42273010b06eb097fc98 to your computer and use it in GitHub Desktop.
webfaction-fabfile.py
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 | |
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