I'm trying to deploy an "app" written on top off web.py with fabric on a VPS running Arch Linux.
But I'm confused about best pratices regarding Fabric and virtualenv: which user should I use to create the virtualenv and how do I do that using Fabric?
My incomplete fabfile is below.
fabfile.py:
from fabric.api import cd, env, local, put, run, sudo
env.project = 'project_name'
def setup():
sudo('pacman -S python2-virtualenv python-virtualenvwrapper')
def pack():
local('python setup.py sdist --formats=gztar', capture=False)
def deploy():
dist = local('python setup.py --fullname', capture=True).strip()
put('dist/%s.tar.gz' % dist, '/tmp/%s.tar.gz' % dist)
with cd('/tmp'):
run('tar xzf /tmp/%s.tar.gz' % dist)
run('rm -rf /tmp/%s.tar.gz' % dist)