Skip to content

Commit

Permalink
Merge pull request #214 from UW-GAC/deploy/stage
Browse files Browse the repository at this point in the history
Deploy cron support files to prod
  • Loading branch information
jmcarson authored Mar 14, 2023
2 parents 0e2d969 + 1a65a49 commit d624af1
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gregor-apps-activate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export DJANGO_SITE_DIR=/var/www/django/gregor_apps/
export DJANGO_SITE_USER=gregorweb
export DJANGO_SETTINGS_MODULE=config.settings.apps
export DJANGO_WSGI_FILE=config/gregor_apps_wsgi.py
export GAC_ENV=gregor_apps
cd $DJANGO_SITE_DIR
. venv/bin/activate
11 changes: 11 additions & 0 deletions gregor-apps-dev-activate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Sets environment variables, changes directory and activates venv
# for gregor apps dev env
# Used by crontab, validate any changes

export DJANGO_SITE_DIR=/var/www/django/gregor_apps_dev/
export DJANGO_SITE_USER=gregorweb
export DJANGO_SETTINGS_MODULE=config.settings.apps_dev
export DJANGO_WSGI_FILE=config/apps_dev_wsgi.py
export GAC_ENV=gregor_apps_dev
cd $DJANGO_SITE_DIR
. venv/bin/activate
6 changes: 6 additions & 0 deletions gregor_apps.cron
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# GREGOR_APPS crontab
# nightly except sunday at 00:00
0 0 * * MON-SAT . /var/www/django/gregor_apps/gregor-apps-activate.sh; python manage.py run_anvil_audit --email [email protected] --errors-only >> cron.log 2>&1

# sunday night at 00:00
0 0 * * SUN . /var/www/django/gregor_apps/gregor-apps-activate.sh; python manage.py run_anvil_audit --email [email protected] >> cron.log 2>&1
7 changes: 7 additions & 0 deletions gregor_apps_dev.cron
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# GREGOR_APPS_DEV crontab - disabled by default
# can be enabled for testing.
# nightly except sunday at 00:00
# 0 0 * * MON-SAT . /var/www/django/gregor_apps/gregor-apps-dev-activate.sh; python manage.py run_anvil_audit --email [email protected] --errors-only >> cron.log 2>&1

# sunday night at 00:00
# 0 0 * * SUN . /var/www/django/gregor_apps/gregor-apps-dev-activate.sh; python manage.py run_anvil_audit --email [email protected] >> cron.log 2>&1

0 comments on commit d624af1

Please sign in to comment.