Tweak how backups are configured, to be a tad more generic
This commit is contained in:
parent
2df0cf1b27
commit
5df0e0d16f
|
@ -54,11 +54,15 @@ def deploy_backup_app(deploy, envname, mkvirtualenv=True, user='rattail',
|
|||
Make an app which can run backups for the server.
|
||||
"""
|
||||
if not config:
|
||||
path = '{}/rattail.conf'.format(envname)
|
||||
path = '{}/rattail.conf.mako'.format(envname)
|
||||
if deploy.local_exists(path):
|
||||
config = path
|
||||
else:
|
||||
raise ValueError("Must provide config path for backup app")
|
||||
path = '{}/rattail.conf'.format(envname)
|
||||
if deploy.local_exists(path):
|
||||
config = path
|
||||
else:
|
||||
raise ValueError("Must provide config path for backup app")
|
||||
|
||||
if runat is UNSPECIFIED:
|
||||
runat = datetime.time(0) # defaults to midnight
|
||||
|
@ -82,7 +86,10 @@ def deploy_backup_app(deploy, envname, mkvirtualenv=True, user='rattail',
|
|||
|
||||
# config
|
||||
sudo('bin/rattail make-appdir', user=user)
|
||||
deploy(config, 'app/rattail.conf', owner=user, mode='0600')
|
||||
config_context = {
|
||||
'user': user,
|
||||
}
|
||||
deploy(config, 'app/rattail.conf', owner=user, mode='0600', context=config_context)
|
||||
sudo('bin/rattail -c app/rattail.conf make-config -T quiet -O app/', user=user)
|
||||
sudo('bin/rattail -c app/rattail.conf make-config -T silent -O app/', user=user)
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ if [ "$(sudo -u ${user} git status --porcelain)" != '' ]; then
|
|||
exit 1
|
||||
fi
|
||||
sudo -u ${user} git pull $QUIET
|
||||
sudo -u ${user} find . -name '*.pyc' -delete
|
||||
sudo find . -name '*.pyc' -delete
|
||||
$PIP install $QUIET --upgrade --upgrade-strategy eager --editable .
|
||||
|
||||
# run backup
|
||||
|
|
Loading…
Reference in a new issue