Slight tweaks when making backup venv

This commit is contained in:
Lance Edgar 2023-01-02 15:01:39 -06:00
parent a3339ac062
commit cfba5425a1

View file

@ -91,16 +91,15 @@ def deploy_backup_app(c, deploy, envname, mkvirtualenv=True, user='rattail',
# virtualenv
envpath = '/srv/envs/{}'.format(envname)
if mkvirtualenv and not exists(c, envpath):
mkdir(c, envpath, use_sudo=True, owner=user)
python.mkvirtualenv(c, envname, python=python_exe, runas_user=user)
# TODO: this should not be necessary, right?
c.sudo('chown -R {}: {}'.format(user, envpath))
c.sudo("bash -c 'PIP_CONFIG_FILE={0}/pip.conf {0}/bin/pip install -U pip setuptools wheel'".format(envpath),
user=user)
mkdir(c, os.path.join(envpath, 'src'), use_sudo=True, runas_user=user)
if install_rattail:
# rattail
mkdir(c, os.path.join(envpath, 'src'), use_sudo=True, runas_user=user)
if not exists(c, os.path.join(envpath, 'src/rattail')):
c.sudo('git clone https://kallithea.rattailproject.org/rattail-project/rattail {}/src/rattail'.format(envpath), user=user)
c.sudo("bash -c 'PIP_CONFIG_FILE={0}/pip.conf {0}/bin/pip install --editable {0}/src/rattail'".format(envpath),