Find file
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (18 sloc) 710 Bytes
from __future__ import with_statement
from fabric.api import *
from fabric.contrib.console import confirm
env.hosts = ['']
def test():
with settings(warn_only=True):
result = local('python', capture=True)
if result.failed and not confirm("Tests failed. Continue anyway?"):
abort("Aborting at user request.")
def deploy():
code_dir = '/home/david/DontPanic'
with settings(warn_only=True):
if run("test -d %s" % code_dir).failed:
run("git clone git:// %s" % code_dir)
with cd(code_dir):
run("git pull")
sudo("/usr/bin/supervisorctl restart all")