fabfile upgrades

This commit is contained in:
Kenneth Reitz
2011-06-15 23:57:18 -04:00
parent 1bf005af45
commit ebe2a5ab52
Vendored
+39 -4
View File
@@ -6,6 +6,7 @@ from fabric.api import *
CMD_TEMPLATE = '{0}'
EPIO_TEMPLATE = 'epio {0}'
def _run(cmd):
@@ -24,17 +25,51 @@ def docs():
os.system("cat README.md|sed 's/(http:\/\/httpbin.org\//(\//'|ronn -5 -f --style 80c --pipe > ./httpbin/templates/httpbin.1.html")
def epio(cmd):
"""Runs given command on EPIO."""
c = EPIO_TEMPLATE.format(cmd)
print c
os.system(c)
def prod():
"""Runs all command on the production instance."""
global CMD_TEMPLATE
global EPIO_TEMPLATE
CMD_TEMPLATE = 'epio run_command {0}'
CMD_TEMPLATE = 'epio run_command {0} -a httpbin'
EPIO_TEMPLATE = 'epio {0} -a httpbin '
def stag():
"""Runs all command on the staging instance."""
global CMD_TEMPLATE
global EPIO_TEMPLATE
CMD_TEMPLATE = 'epio run_command {0} -a httpbin-staging'
EPIO_TEMPLATE = 'epio {0} -a httpbin-staging '
def push():
"""Deploys the application"""
"""Pushes the application"""
docs()
prod()
local('epio upload')
epio('upload')
def stage():
"""Deploys the application."""
stag()
push()
def deploy():
"""Deploys the application."""
prod()
push()