From 8e5f42816d480038e065b7be3d649e1b506b31a8 Mon Sep 17 00:00:00 2001 From: bobcall Date: Sat, 29 Jun 2013 07:08:31 -0400 Subject: [PATCH] Added remote support and the ability to pull code --- fabfile.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fabfile.py b/fabfile.py index 95e6bd1..937fef7 100644 --- a/fabfile.py +++ b/fabfile.py @@ -27,6 +27,17 @@ Connection information for the local machine env.branch = 'beta' env.run = virtenv_exec +@task +def prod(): + env.user = 'djkarma' + env.hosts = ['beta.karmanotes.org'] + env.proj_root = '/var/www/karmaworld' + env.proj_dir = '/var/www/karmaworld' + env.reqs = 'reqs/prod.txt' + env.confs = 'confs/beta/' + env.branch = 'beta' + env.run = virtenv_exec + ######## Run Commands in Virutal Environment def virtenv_exec(command): with virtualenv('%s/%s' % (env.proj_dir, env.branch)): @@ -62,3 +73,6 @@ def start_supervisord(): config_file = '%s/%ssupervisord.conf' % (env.proj_dir,env.confs) env.run('supervisord -c %s' % config_file) +@task +def update_code(): + env.run('cd %s; git pull' % env.proj_dir) -- 2.25.1