From d713bbe522d32922d33bac0c618fbbd33e848fe3 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 10 Jun 2023 18:57:57 -0500 Subject: [PATCH] Let caller override default `fannie/config.php` also make `deploy.full_path()` honor absolute path when given one --- rattail_fabric2/core.py | 2 ++ rattail_fabric2/corepos.py | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/rattail_fabric2/core.py b/rattail_fabric2/core.py index 2086d23..844eab4 100644 --- a/rattail_fabric2/core.py +++ b/rattail_fabric2/core.py @@ -239,6 +239,8 @@ class Deployer(object): self.deploy(c, local_path, remote_path, **kwargs) def full_path(self, local_path): + if local_path.startswith('/'): + return local_path return '{}/{}'.format(self.deploy_path, local_path) def local_exists(self, local_path): diff --git a/rattail_fabric2/corepos.py b/rattail_fabric2/corepos.py index 4f160a3..ac0a10d 100644 --- a/rattail_fabric2/corepos.py +++ b/rattail_fabric2/corepos.py @@ -41,7 +41,8 @@ def install_corepos(c, rootdir, rooturl_office, production=True, mysql_name_prefix='', composer='composer.phar', composer_install=True, - make_shadowread=False): + make_shadowread=False, + fannie_config=True): """ Install the CORE software to the given location. @@ -93,15 +94,18 @@ def install_corepos(c, rootdir, rooturl_office, production=True, user='{}@localhost'.format(mysql_username)) # fannie config - remote_path = '{}/IS4C/fannie/config.php'.format(rootdir) - if not exists(c, remote_path): - deploy_generic(c, 'corepos/fannie-config.php.mako', remote_path, - use_sudo=True, owner='www-data:{}'.format(user), mode='0640', - context={'rootdir': rootdir, - 'rooturl': rooturl_office, - 'mysql_username': mysql_username, - 'mysql_password': mysql_password, - 'mysql_name_prefix': mysql_name_prefix}) + if fannie_config: + remote_path = '{}/IS4C/fannie/config.php'.format(rootdir) + if not exists(c, remote_path): + if fannie_config is True: + fannie_config = 'corepos/fannie-config.php.mako' + deploy_generic(c, fannie_config, remote_path, + use_sudo=True, owner='www-data:{}'.format(user), mode='0640', + context={'rootdir': rootdir, + 'rooturl': rooturl_office, + 'mysql_username': mysql_username, + 'mysql_password': mysql_password, + 'mysql_name_prefix': mysql_name_prefix}) # fannie logging mkdir(c, f'{is4c}/fannie/logs', use_sudo=True,