Allow custom email key for overnight scripts
This commit is contained in:
parent
5a4e2701df
commit
f97401009e
|
@ -18,4 +18,9 @@ cd ${envroot}
|
|||
|
||||
RATTAIL="bin/rattail --config=app/cron.conf $PROGRESS"
|
||||
|
||||
$RATTAIL run-n-mail --no-versioning --skip-if-empty --subject 'Overnight automation: ${automation}' ${envroot}/app/overnight-${automation.lower()}.sh
|
||||
$RATTAIL run-n-mail --no-versioning --skip-if-empty <%text>\</%text>
|
||||
% if email_key is not Undefined and email_key:
|
||||
--key '${email_key}' <%text>\</%text>
|
||||
% endif
|
||||
--subject 'Overnight automation: ${automation}' <%text>\</%text>
|
||||
${envroot}/app/overnight-${automation.lower()}.sh
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
DATE=`date --date='yesterday' +%Y-%m-%d`
|
||||
|
||||
echo "${envroot}/bin/rattail -c ${appdir}/cron.conf --no-versioning run-n-mail -S 'Overnight catch-up: ${automation}' '${appdir}/overnight-${automation.lower()}.sh $DATE'" | at 'now + 1 minute'
|
||||
echo "${envroot}/bin/rattail -c ${appdir}/cron.conf --no-versioning run-n-mail ${"--key '{}'".format(email_key) if email_key is not Undefined and email_key else ''} -S 'Overnight catch-up: ${automation}' '${appdir}/overnight-${automation.lower()}.sh $DATE'" | at 'now + 1 minute'
|
||||
|
|
|
@ -72,7 +72,8 @@ def install_luigi(c, envroot, luigi='luigi', user='rattail', db_connection=None)
|
|||
context={'appdir': appdir})
|
||||
|
||||
|
||||
def install_overnight_script(c, envroot, user='rattail', automation='All'):
|
||||
def install_overnight_script(c, envroot, user='rattail', automation='All',
|
||||
email_key=None):
|
||||
"""
|
||||
Install an overnight automation script
|
||||
"""
|
||||
|
@ -93,7 +94,8 @@ def install_overnight_script(c, envroot, user='rattail', automation='All'):
|
|||
'{}/{}'.format(appdir, filename),
|
||||
use_sudo=True, owner=user, mode='0755',
|
||||
context={'envroot': envroot,
|
||||
'automation': automation})
|
||||
'automation': automation,
|
||||
'email_key': email_key})
|
||||
|
||||
# restart-overnight-*.sh
|
||||
filename = 'restart-overnight-{}.sh'.format(automation.lower())
|
||||
|
@ -102,7 +104,8 @@ def install_overnight_script(c, envroot, user='rattail', automation='All'):
|
|||
use_sudo=True, owner=user, mode='0755',
|
||||
context={'envroot': envroot,
|
||||
'appdir': appdir,
|
||||
'automation': automation})
|
||||
'automation': automation,
|
||||
'email_key': email_key})
|
||||
|
||||
|
||||
def register_with_supervisor(c, envroot, user='rattail', autostart=False):
|
||||
|
|
Loading…
Reference in a new issue