Make each overnight script optional
trying to phase out at least 1, maybe 2 of them... this also cleans up the 'restart' script to use 'rattail overnight' per recent changes. this seems the most useful to have around, in case of web app failure
This commit is contained in:
parent
a36ecdb2ad
commit
25891902b8
|
@ -1,10 +1,4 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
<%text>############################################################</%text>
|
|
||||||
#
|
|
||||||
# overnight automation (${automation}) via cron
|
|
||||||
#
|
|
||||||
<%text>############################################################</%text>
|
|
||||||
|
|
||||||
|
|
||||||
cd ${envroot}
|
cd ${envroot}
|
||||||
|
|
||||||
|
@ -15,4 +9,5 @@ $RATTAIL overnight ${automation.lower()} <%text>\</%text>
|
||||||
% if email_key is not Undefined and email_key:
|
% if email_key is not Undefined and email_key:
|
||||||
--email-key '${email_key}' <%text>\</%text>
|
--email-key '${email_key}' <%text>\</%text>
|
||||||
% endif
|
% endif
|
||||||
--no-email-if-empty
|
--no-email-if-empty <%text>\</%text>
|
||||||
|
--wait
|
||||||
|
|
|
@ -1,5 +1,13 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
DATE=`date --date='yesterday' +%Y-%m-%d`
|
cd ${envroot}
|
||||||
|
|
||||||
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'
|
RATTAIL="bin/rattail --config=app/cron.conf"
|
||||||
|
|
||||||
|
$RATTAIL overnight ${automation.lower()} <%text>\</%text>
|
||||||
|
--no-versioning <%text>\</%text>
|
||||||
|
% if email_key is not Undefined and email_key:
|
||||||
|
--email-key '${email_key}' <%text>\</%text>
|
||||||
|
% endif
|
||||||
|
--email-if-empty <%text>\</%text>
|
||||||
|
--no-wait
|
||||||
|
|
|
@ -73,7 +73,8 @@ def install_luigi(c, envroot, luigi='luigi', user='rattail', db_connection=None)
|
||||||
|
|
||||||
|
|
||||||
def install_overnight_script(c, envroot, user='rattail', automation='All',
|
def install_overnight_script(c, envroot, user='rattail', automation='All',
|
||||||
email_key=None):
|
email_key=None,
|
||||||
|
luigi=True, cron=True, restart=True):
|
||||||
"""
|
"""
|
||||||
Install an overnight automation script
|
Install an overnight automation script
|
||||||
"""
|
"""
|
||||||
|
@ -81,6 +82,7 @@ def install_overnight_script(c, envroot, user='rattail', automation='All',
|
||||||
appdir = '{}/app'.format(envroot)
|
appdir = '{}/app'.format(envroot)
|
||||||
|
|
||||||
# overnight-*.sh
|
# overnight-*.sh
|
||||||
|
if luigi:
|
||||||
filename = 'overnight-{}.sh'.format(automation.lower())
|
filename = 'overnight-{}.sh'.format(automation.lower())
|
||||||
deploy_common(c, 'luigi/overnight.sh.mako',
|
deploy_common(c, 'luigi/overnight.sh.mako',
|
||||||
'{}/{}'.format(appdir, filename),
|
'{}/{}'.format(appdir, filename),
|
||||||
|
@ -89,6 +91,7 @@ def install_overnight_script(c, envroot, user='rattail', automation='All',
|
||||||
'automation': automation})
|
'automation': automation})
|
||||||
|
|
||||||
# cron-overnight-*.sh
|
# cron-overnight-*.sh
|
||||||
|
if cron:
|
||||||
filename = 'cron-overnight-{}.sh'.format(automation.lower())
|
filename = 'cron-overnight-{}.sh'.format(automation.lower())
|
||||||
deploy_common(c, 'luigi/cron-overnight.sh.mako',
|
deploy_common(c, 'luigi/cron-overnight.sh.mako',
|
||||||
'{}/{}'.format(appdir, filename),
|
'{}/{}'.format(appdir, filename),
|
||||||
|
@ -98,6 +101,7 @@ def install_overnight_script(c, envroot, user='rattail', automation='All',
|
||||||
'email_key': email_key})
|
'email_key': email_key})
|
||||||
|
|
||||||
# restart-overnight-*.sh
|
# restart-overnight-*.sh
|
||||||
|
if restart:
|
||||||
filename = 'restart-overnight-{}.sh'.format(automation.lower())
|
filename = 'restart-overnight-{}.sh'.format(automation.lower())
|
||||||
deploy_common(c, 'luigi/restart-overnight.sh.mako',
|
deploy_common(c, 'luigi/restart-overnight.sh.mako',
|
||||||
'{}/{}'.format(appdir, filename),
|
'{}/{}'.format(appdir, filename),
|
||||||
|
|
Loading…
Reference in a new issue