Add pyfuse3 support for backup (borg) app
This commit is contained in:
parent
a9bbee572a
commit
1fedc314b3
|
@ -2,7 +2,7 @@
|
|||
################################################################################
|
||||
#
|
||||
# Rattail -- Retail Software Framework
|
||||
# Copyright © 2010-2019 Lance Edgar
|
||||
# Copyright © 2010-2022 Lance Edgar
|
||||
#
|
||||
# This file is part of Rattail.
|
||||
#
|
||||
|
@ -55,6 +55,7 @@ def deploy_backup_everything(c, **context):
|
|||
def deploy_backup_app(c, deploy, envname, mkvirtualenv=True, user='rattail',
|
||||
python_exe='/usr/bin/python3',
|
||||
install_borg=False,
|
||||
pyfuse3=False,
|
||||
link_borg_to_bin=True,
|
||||
install_luigi=False,
|
||||
luigi_history_db=None,
|
||||
|
@ -93,9 +94,9 @@ def deploy_backup_app(c, deploy, envname, mkvirtualenv=True, user='rattail',
|
|||
python.mkvirtualenv(c, envname, python=python_exe, runas_user=user)
|
||||
# TODO: this should not be necessary, right?
|
||||
c.sudo('chown -R {}: {}'.format(user, envpath))
|
||||
mkdir(c, os.path.join(envpath, 'src'), use_sudo=True, runas_user=user)
|
||||
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:
|
||||
|
||||
|
@ -131,16 +132,18 @@ def deploy_backup_app(c, deploy, envname, mkvirtualenv=True, user='rattail',
|
|||
|
||||
# borg
|
||||
if install_borg:
|
||||
if install_rattail:
|
||||
packages = [
|
||||
'rattail[backup]',
|
||||
]
|
||||
if isinstance(install_borg, list):
|
||||
packages = install_borg
|
||||
elif isinstance(install_borg, str):
|
||||
packages = [install_borg]
|
||||
else:
|
||||
# TODO: these should be same as rattail[backup]
|
||||
packages = [
|
||||
'msgpack',
|
||||
'borgbackup[fuse]',
|
||||
]
|
||||
packages = ['msgpack']
|
||||
if pyfuse3:
|
||||
apt.install(c, 'libfuse3-dev')
|
||||
packages.append('borgbackup[pyfuse3]')
|
||||
else:
|
||||
# TODO: this is legacy and should stop being default
|
||||
packages.append('borgbackup[fuse]')
|
||||
c.sudo("bash -c 'PIP_CONFIG_FILE={0}/pip.conf {0}/bin/pip install {1}'".format(envpath, ' '.join(packages)),
|
||||
user=user)
|
||||
if link_borg_to_bin:
|
||||
|
|
Loading…
Reference in a new issue