Let caller override config paths for luigi overnight scripts

This commit is contained in:
Lance Edgar 2022-11-27 12:47:39 -06:00
parent ebf94fb7dc
commit a9bbee572a
3 changed files with 9 additions and 5 deletions

View file

@ -2,9 +2,9 @@
cd ${envroot}
RATTAIL="bin/rattail --config=app/cron.conf"
export RATTAIL_CONFIG_FILES=${overnight_conf}
$RATTAIL overnight -k ${automation.lower()} <%text>\</%text>
bin/rattail overnight -k ${automation.lower()} <%text>\</%text>
--no-versioning <%text>\</%text>
% if email_key is not Undefined and email_key:
--email-key '${email_key}' <%text>\</%text>

View file

@ -2,9 +2,9 @@
cd ${envroot}
RATTAIL="bin/rattail --config=app/cron.conf"
export RATTAIL_CONFIG_FILES=${overnight_conf}
$RATTAIL overnight -k ${automation.lower()} <%text>\</%text>
bin/rattail overnight -k ${automation.lower()} <%text>\</%text>
--no-versioning <%text>\</%text>
% if email_key is not Undefined and email_key:
--email-key '${email_key}' <%text>\</%text>

View file

@ -74,7 +74,9 @@ def install_luigi(c, envroot, luigi='luigi', user='rattail', db_connection=None)
def install_overnight_script(c, envroot, user='rattail', automation='All',
email_key=None,
luigi=False, cron=True, restart=True):
luigi=False,
cron=True, cron_conf='app/cron.conf',
restart=True, restart_conf='app/silent.conf'):
"""
Install an overnight automation script
"""
@ -97,6 +99,7 @@ def install_overnight_script(c, envroot, user='rattail', automation='All',
'{}/{}'.format(appdir, filename),
use_sudo=True, owner=user, mode='0755',
context={'envroot': envroot,
'overnight_conf': cron_conf,
'automation': automation,
'email_key': email_key})
@ -108,6 +111,7 @@ def install_overnight_script(c, envroot, user='rattail', automation='All',
use_sudo=True, owner=user, mode='0755',
context={'envroot': envroot,
'appdir': appdir,
'overnight_conf': restart_conf,
'automation': automation,
'email_key': email_key})