From fc40b0ee244af950710a5c6fc82f64efa8f6e4ab Mon Sep 17 00:00:00 2001 From: bobcall Date: Mon, 1 Jul 2013 01:32:28 -0400 Subject: [PATCH] Added the ability to start gunicorn --- fabfile.py | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/fabfile.py b/fabfile.py index 7ae1f33..dee8d60 100644 --- a/fabfile.py +++ b/fabfile.py @@ -27,6 +27,7 @@ def here(): env.branch = 'beta' env.run = virtenv_exec +####### Define production host @task def prod(): """ @@ -52,8 +53,6 @@ def virtenv_exec(command): with virtualenv('%s/%s' % (env.proj_dir, env.branch)): run('%s' % (command)) - - ######## Sync database @task def syncdb(): @@ -89,9 +88,10 @@ def make_virtualenv(): Create our Virtualenv in $SRC_ROOT """ - run('virtualenv %s/%s' % (env.proj_dir, env.branch)) + run('virtualenv %s/%s' % (env.proj_root, env.branch)) env.run('pip install -r %s/reqs/dev.txt' % env.proj_dir ) +####### Start Gunicorn @task def start_gunicorn(): """ @@ -99,27 +99,13 @@ def start_gunicorn(): """ env.run('%s/manage.py run_gunicorn -b %s -u %s -p var/run/gunicorn.pid' % (env.proj_root, env.gunicorn_addr, env.user) +####### Update Requirements @task def update_reqs(): - env.run('pip install -r reqs/dev.txt') - + env.run('pip install -r reqs/prod.txt') +####### Pull new code @task def update_code(): env.run('cd %s; git pull' % env.proj_dir) -@task -def deploy(): - """ - Deploys the latest changes - """ - update_code() - update_reqs() - syncdb() - collect_static() - restart_supervisord() - - -@task -def User(): - env.run('whoami') -- 2.25.1