Avoid use of workon
when deploying backup app
should not assume presence of virtualenvwrapper for this
This commit is contained in:
parent
9ae0015aba
commit
506b88d3e2
|
@ -105,11 +105,19 @@ def deploy_backup_app(c, deploy, envname, mkvirtualenv=True, user='rattail',
|
|||
deploy_generic(c, 'backup/git-exclude', os.path.join(envpath, 'src/rattail/.git/info/exclude'), use_sudo=True, owner=user)
|
||||
|
||||
# config
|
||||
c.sudo("bash -l -c 'workon {} && cdvirtualenv && rattail make-appdir'".format(envname), user=user)
|
||||
if not exists(c, os.path.join(envpath, 'app')):
|
||||
c.sudo("bash -c 'cd {} && bin/rattail make-appdir'".format(envpath),
|
||||
user=user)
|
||||
# note, config is owned by root regardless of `user` - since we always run backups as root
|
||||
deploy(c, config, os.path.join(envpath, 'app/rattail.conf'), owner='root:{}'.format(user), mode='0640', use_sudo=True, context=context)
|
||||
c.sudo("bash -l -c 'workon {} && cdvirtualenv && bin/rattail -c app/rattail.conf make-config -T quiet -O app/'".format(envname), user=user)
|
||||
c.sudo("bash -l -c 'workon {} && cdvirtualenv && bin/rattail -c app/rattail.conf make-config -T silent -O app/'".format(envname), user=user)
|
||||
deploy(c, config, os.path.join(envpath, 'app/rattail.conf'),
|
||||
use_sudo=True, owner='root:{}'.format(user), mode='0640',
|
||||
context=context)
|
||||
if not exists(c, os.path.join(envpath, 'app', 'quiet.conf')):
|
||||
c.sudo("bash -c 'cd {} && bin/rattail -c app/rattail.conf make-config -T quiet -O app/'".format(envpath),
|
||||
user=user)
|
||||
if not exists(c, os.path.join(envpath, 'app', 'silent.conf')):
|
||||
c.sudo("bash -c 'cd {} && bin/rattail -c app/rattail.conf make-config -T silent -O app/".format(envpath),
|
||||
user=user)
|
||||
|
||||
# rattail-backup script
|
||||
script_context = dict(context)
|
||||
|
|
Loading…
Reference in a new issue