fabfile edits

This commit is contained in:
sanj 2010-03-02 22:31:49 +05:30
parent 55abf380c0
commit 2869955951

8
fabfile.py vendored
View File

@ -14,10 +14,10 @@ env.project_name = 'index'
def production(): def production():
env.hosts = ['%(project_name)s@camp.r-w-x.org'%env, ] env.hosts = ['%(project_name)s@camp.r-w-x.org'%env, ]
env.project_root = '/srv/(project_name)]s'%env env.project_root = '/srv/%(project_name)s'%env
def bzr_push(): def bzr_push():
local('bzr push bzr+ssh://%(host)s%(project_root)s'%env) local('bzr push bzr+ssh://%(project_name)s@%(host)s%(project_root)s'%env)
def bzr_update(): def bzr_update():
run('cd %(project_root)s;bzr update'%env) run('cd %(project_root)s;bzr update'%env)
@ -33,7 +33,7 @@ def setup():
""" """
Setup a fresh virtualenv Setup a fresh virtualenv
""" """
local('bzr push --use-existing-dir bzr+ssh://%(host)s%(project_root)s'%env) local('bzr push --use-existing-dir bzr+ssh://%(project_name)s@%(host)s%(project_root)s'%env)
run('cd %(project_root)s; test -e .bzr/checkout || bzr checkout'%env) run('cd %(project_root)s; test -e .bzr/checkout || bzr checkout'%env)
run('virtualenv %(project_root)s'%env) run('virtualenv %(project_root)s'%env)
put(join('settings', '%(host)s.py'%env), join(env.project_root, env.project_name, 'local_settings.py')) put(join('settings', '%(host)s.py'%env), join(env.project_root, env.project_name, 'local_settings.py'))
@ -42,5 +42,5 @@ def setup():
def deploy(): def deploy():
bzr_push() bzr_push()
bzr_update() bzr_update()
virtual_run('python index/manage.py syncdb;python index/manage.py migrate'%env) virtual_run('python %(project_root)s/manage.py syncdb;python %(project_root)s/manage.py migrate'%env)
run('touch %(project_root)s/wsgi/django.wsgi'%env) run('touch %(project_root)s/wsgi/django.wsgi'%env)