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
3 changed files with 41 additions and 34 deletions
|
@ -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',
|
||||
email_key=None):
|
||||
email_key=None,
|
||||
luigi=True, cron=True, restart=True):
|
||||
"""
|
||||
Install an overnight automation script
|
||||
"""
|
||||
|
@ -81,31 +82,34 @@ def install_overnight_script(c, envroot, user='rattail', automation='All',
|
|||
appdir = '{}/app'.format(envroot)
|
||||
|
||||
# overnight-*.sh
|
||||
filename = 'overnight-{}.sh'.format(automation.lower())
|
||||
deploy_common(c, 'luigi/overnight.sh.mako',
|
||||
'{}/{}'.format(appdir, filename),
|
||||
use_sudo=True, owner=user, mode='0755',
|
||||
context={'envroot': envroot, 'appdir': appdir,
|
||||
'automation': automation})
|
||||
if luigi:
|
||||
filename = 'overnight-{}.sh'.format(automation.lower())
|
||||
deploy_common(c, 'luigi/overnight.sh.mako',
|
||||
'{}/{}'.format(appdir, filename),
|
||||
use_sudo=True, owner=user, mode='0755',
|
||||
context={'envroot': envroot, 'appdir': appdir,
|
||||
'automation': automation})
|
||||
|
||||
# cron-overnight-*.sh
|
||||
filename = 'cron-overnight-{}.sh'.format(automation.lower())
|
||||
deploy_common(c, 'luigi/cron-overnight.sh.mako',
|
||||
'{}/{}'.format(appdir, filename),
|
||||
use_sudo=True, owner=user, mode='0755',
|
||||
context={'envroot': envroot,
|
||||
'automation': automation,
|
||||
'email_key': email_key})
|
||||
if cron:
|
||||
filename = 'cron-overnight-{}.sh'.format(automation.lower())
|
||||
deploy_common(c, 'luigi/cron-overnight.sh.mako',
|
||||
'{}/{}'.format(appdir, filename),
|
||||
use_sudo=True, owner=user, mode='0755',
|
||||
context={'envroot': envroot,
|
||||
'automation': automation,
|
||||
'email_key': email_key})
|
||||
|
||||
# restart-overnight-*.sh
|
||||
filename = 'restart-overnight-{}.sh'.format(automation.lower())
|
||||
deploy_common(c, 'luigi/restart-overnight.sh.mako',
|
||||
'{}/{}'.format(appdir, filename),
|
||||
use_sudo=True, owner=user, mode='0755',
|
||||
context={'envroot': envroot,
|
||||
'appdir': appdir,
|
||||
'automation': automation,
|
||||
'email_key': email_key})
|
||||
if restart:
|
||||
filename = 'restart-overnight-{}.sh'.format(automation.lower())
|
||||
deploy_common(c, 'luigi/restart-overnight.sh.mako',
|
||||
'{}/{}'.format(appdir, filename),
|
||||
use_sudo=True, owner=user, mode='0755',
|
||||
context={'envroot': envroot,
|
||||
'appdir': appdir,
|
||||
'automation': automation,
|
||||
'email_key': email_key})
|
||||
|
||||
|
||||
def register_with_supervisor(c, envroot, user='rattail', autostart=False):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue