Skip to content

Commit

Permalink
Added optional (very basic) fabric deploy file
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchilds committed Sep 7, 2011
1 parent b4a0edd commit 8af169a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ Requires:
* Werkzeug - http://werkzeug.pocoo.org/
* Django-registration - https://bitbucket.org/ubernostrum/django-registration/
* Django-evolution - http://code.google.com/p/django-evolution/

Optional:

* Fabric
28 changes: 28 additions & 0 deletions fabfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import fabric
from fabric.api import *
import sys

env.hosts = ['USER@HOSTNAME']

def deploy():
_check_code()
code_dir = 'WHERE YOU STORE YOUR CODE, e.g. /srv/www/'
with cd(code_dir):
run("git pull origin master")
run('/etc/init.d/apache2 reload')

def _check_code():
file_list = local("git status --porcelain", capture=True)
files = file_list.split('\n')
if files[0] != "":
print("Unchecked in files...")
for f in files:
print(f)
if fabric.contrib.console.confirm("There are files not checked in. Are you sure you want to continue?"):
print("Continuing with deployment...")
else:
print("Quitting deployment")
sys.exit()



0 comments on commit 8af169a

Please sign in to comment.