Avoid workon command when deploying backup app

This commit is contained in:
Lance Edgar 2022-11-28 16:49:56 -06:00
parent 1fedc314b3
commit a3339ac062

View file

@ -103,7 +103,8 @@ def deploy_backup_app(c, deploy, envname, mkvirtualenv=True, user='rattail',
# rattail # rattail
if not exists(c, os.path.join(envpath, 'src/rattail')): 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('git clone https://kallithea.rattailproject.org/rattail-project/rattail {}/src/rattail'.format(envpath), user=user)
c.sudo("bash -l -c 'workon {} && cdvirtualenv && bin/pip install --editable src/rattail'".format(envname), user=user) c.sudo("bash -c 'PIP_CONFIG_FILE={0}/pip.conf {0}/bin/pip install --editable {0}/src/rattail'".format(envpath),
user=user)
deploy_generic(c, 'backup/git-exclude', os.path.join(envpath, 'src/rattail/.git/info/exclude'), use_sudo=True, owner=user) deploy_generic(c, 'backup/git-exclude', os.path.join(envpath, 'src/rattail/.git/info/exclude'), use_sudo=True, owner=user)
# config # config
@ -156,7 +157,8 @@ def deploy_backup_app(c, deploy, envname, mkvirtualenv=True, user='rattail',
packages.append('SQLAlchemy') packages.append('SQLAlchemy')
if luigi_history_db.startswith('postgresql://'): if luigi_history_db.startswith('postgresql://'):
packages.append('psycopg2') packages.append('psycopg2')
c.sudo("bash -l -c 'workon {}; pip install {}'".format(envname, ' '.join(packages)), user=user) c.sudo("bash -c 'PIP_CONFIG_FILE={0}/pip.conf {0}/bin/pip install {1}'".format(envpath, ' '.join(packages)),
user=user)
# basic config # basic config
mkdir(c, ['{}/app/luigitasks'.format(envpath), mkdir(c, ['{}/app/luigitasks'.format(envpath),