Changeset 2589190 in rattail-fabric2
- Timestamp:
- 11/20/2022 08:03:28 PM (2 months ago)
- Branches:
- master
- Children:
- 4c8e956
- Parents:
- a36ecdb
- git-author:
- Lance Edgar <lance@…> (11/20/2022 08:02:48 PM)
- git-committer:
- Lance Edgar <lance@…> (11/20/2022 08:03:28 PM)
- Location:
- rattail_fabric2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
rattail_fabric2/deploy/luigi/cron-overnight.sh.mako
ra36ecdb r2589190 1 1 #!/bin/sh -e 2 <%text>############################################################</%text>3 #4 # overnight automation (${automation}) via cron5 #6 <%text>############################################################</%text>7 8 2 9 3 cd ${envroot} … … 13 7 $RATTAIL overnight ${automation.lower()} <%text>\</%text> 14 8 --no-versioning <%text>\</%text> 15 % if email_key is not Undefined and email_key: 16 --email-key '${email_key}' <%text>\</%text> 17 % endif 18 --no-email-if-empty 9 % if email_key is not Undefined and email_key: 10 --email-key '${email_key}' <%text>\</%text> 11 % endif 12 --no-email-if-empty <%text>\</%text> 13 --wait -
rattail_fabric2/deploy/luigi/restart-overnight.sh.mako
ra36ecdb r2589190 1 1 #!/bin/sh -e 2 2 3 DATE=`date --date='yesterday' +%Y-%m-%d` 3 cd ${envroot} 4 4 5 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' 5 RATTAIL="bin/rattail --config=app/cron.conf" 6 7 $RATTAIL overnight ${automation.lower()} <%text>\</%text> 8 --no-versioning <%text>\</%text> 9 % if email_key is not Undefined and email_key: 10 --email-key '${email_key}' <%text>\</%text> 11 % endif 12 --email-if-empty <%text>\</%text> 13 --no-wait -
rattail_fabric2/luigi.py
ra36ecdb r2589190 74 74 75 75 def install_overnight_script(c, envroot, user='rattail', automation='All', 76 email_key=None): 76 email_key=None, 77 luigi=True, cron=True, restart=True): 77 78 """ 78 79 Install an overnight automation script … … 82 83 83 84 # overnight-*.sh 84 filename = 'overnight-{}.sh'.format(automation.lower()) 85 deploy_common(c, 'luigi/overnight.sh.mako', 86 '{}/{}'.format(appdir, filename), 87 use_sudo=True, owner=user, mode='0755', 88 context={'envroot': envroot, 'appdir': appdir, 89 'automation': automation}) 85 if luigi: 86 filename = 'overnight-{}.sh'.format(automation.lower()) 87 deploy_common(c, 'luigi/overnight.sh.mako', 88 '{}/{}'.format(appdir, filename), 89 use_sudo=True, owner=user, mode='0755', 90 context={'envroot': envroot, 'appdir': appdir, 91 'automation': automation}) 90 92 91 93 # cron-overnight-*.sh 92 filename = 'cron-overnight-{}.sh'.format(automation.lower()) 93 deploy_common(c, 'luigi/cron-overnight.sh.mako', 94 '{}/{}'.format(appdir, filename), 95 use_sudo=True, owner=user, mode='0755', 96 context={'envroot': envroot, 97 'automation': automation, 98 'email_key': email_key}) 94 if cron: 95 filename = 'cron-overnight-{}.sh'.format(automation.lower()) 96 deploy_common(c, 'luigi/cron-overnight.sh.mako', 97 '{}/{}'.format(appdir, filename), 98 use_sudo=True, owner=user, mode='0755', 99 context={'envroot': envroot, 100 'automation': automation, 101 'email_key': email_key}) 99 102 100 103 # restart-overnight-*.sh 101 filename = 'restart-overnight-{}.sh'.format(automation.lower()) 102 deploy_common(c, 'luigi/restart-overnight.sh.mako', 103 '{}/{}'.format(appdir, filename), 104 use_sudo=True, owner=user, mode='0755', 105 context={'envroot': envroot, 106 'appdir': appdir, 107 'automation': automation, 108 'email_key': email_key}) 104 if restart: 105 filename = 'restart-overnight-{}.sh'.format(automation.lower()) 106 deploy_common(c, 'luigi/restart-overnight.sh.mako', 107 '{}/{}'.format(appdir, filename), 108 use_sudo=True, owner=user, mode='0755', 109 context={'envroot': envroot, 110 'appdir': appdir, 111 'automation': automation, 112 'email_key': email_key}) 109 113 110 114
Note: See TracChangeset
for help on using the changeset viewer.