added more complex stuff

This commit is contained in:
Stephen McQuay 2013-01-24 19:02:39 -08:00
parent db35fe92e0
commit 3beaa660d7

21
interactivity.py Normal file
View File

@ -0,0 +1,21 @@
from fabric.api import run, settings, cd, local, abort
from fabric.contrib.console import confirm
def deploy():
code_dir = '/tmp/blahblah'
with settings(warn_only=True):
if run("test -d %s" % code_dir).failed:
run("git clone http://github.com/smcquay/fabpreso.git {}".format(
code_dir))
with cd(code_dir):
run("git pull")
run("touch app.wsgi")
def test():
with settings(warn_only=True):
result = local('false')
if result.failed and not confirm("Tests failed. Continue anyway?"):
abort("Aborting at user request.")
local('echo ran anyway')