Skip to content

Commit

Permalink
Merge pull request #169 from UW-GAC/deploy/stage
Browse files Browse the repository at this point in the history
Deploy/stage
  • Loading branch information
jmcarson authored Mar 24, 2023
2 parents adf205f + c0e6522 commit 4fe583e
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 2 deletions.
1 change: 0 additions & 1 deletion config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@
"django.template.context_processors.tz",
"django.contrib.messages.context_processors.messages",
"primed.utils.context_processors.settings_context",
"anvil_consortium_manager.context_processors.workspace_adapter",
],
},
}
Expand Down
7 changes: 7 additions & 0 deletions primed-apps-activate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export DJANGO_SITE_DIR=/var/www/django/primed_apps/
export DJANGO_SITE_USER=primedweb
export DJANGO_SETTINGS_MODULE=config.settings.apps
export DJANGO_WSGI_FILE=config/primed_apps_wsgi.py
export GAC_ENV=primed_apps
cd $DJANGO_SITE_DIR
. venv/bin/activate
11 changes: 11 additions & 0 deletions primed-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/primed_apps_dev/
export DJANGO_SITE_USER=primedweb
export DJANGO_SETTINGS_MODULE=config.settings.apps_dev
export DJANGO_WSGI_FILE=config/primed_apps_dev_wsgi.py
export GAC_ENV=primed_apps_dev
cd $DJANGO_SITE_DIR
. venv/bin/activate
1 change: 1 addition & 0 deletions primed/dbgap/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class dbGaPWorkspaceAdapter(BaseWorkspaceAdapter):

type = "dbgap"
name = "dbGaP workspace"
description = "Workspaces containing data from released dbGaP accessions"
list_table_class = tables.dbGaPWorkspaceTable
workspace_data_model = models.dbGaPWorkspace
workspace_data_form_class = forms.dbGaPWorkspaceForm
Expand Down
1 change: 1 addition & 0 deletions primed/dbgap/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,7 @@ def get_api_json_response(
],
"name": workspace,
"namespace": billing_project,
"isLocked": False,
},
}
return json_data
Expand Down
7 changes: 7 additions & 0 deletions primed/miscellaneous_workspaces/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class SimulatedDataWorkspaceAdapter(BaseWorkspaceAdapter):

type = "simulated_data"
name = "Simulated Data workspace"
description = "Workspaces containing simulated data"
list_table_class = WorkspaceTable
workspace_data_model = models.SimulatedDataWorkspace
workspace_data_form_class = forms.SimulatedDataWorkspaceForm
Expand All @@ -24,6 +25,7 @@ class ConsortiumDevelWorkspaceAdapter(BaseWorkspaceAdapter):

type = "devel"
name = "Consortium development workspace"
description = "Workspaces intended for consortium development of methods"
list_table_class = WorkspaceTable
workspace_data_model = models.ConsortiumDevelWorkspace
workspace_data_form_class = forms.ConsortiumDevelWorkspaceForm
Expand All @@ -35,6 +37,9 @@ class ExampleWorkspaceAdapter(BaseWorkspaceAdapter):

type = "example"
name = "Example workspace"
description = (
"Workspaces containing examples of using AnVIL, working with data, etc."
)
list_table_class = WorkspaceTable
workspace_data_model = models.ExampleWorkspace
workspace_data_form_class = forms.ExampleWorkspaceForm
Expand All @@ -46,6 +51,7 @@ class TemplateWorkspaceAdapter(BaseWorkspaceAdapter):

type = "template"
name = "Template workspace"
description = "Template workspaces that can be cloned to create other workspaces"
list_table_class = WorkspaceTable
workspace_data_model = models.TemplateWorkspace
workspace_data_form_class = forms.TemplateWorkspaceForm
Expand All @@ -57,6 +63,7 @@ class OpenAccessWorkspaceAdapter(BaseWorkspaceAdapter):

type = "open_access"
name = "Open access workspace"
description = "Workspaces containing open access data"
list_table_class = tables.OpenAccessWorkspaceTable
workspace_data_model = models.OpenAccessWorkspace
workspace_data_form_class = forms.OpenAccessWorkspaceForm
Expand Down
5 changes: 5 additions & 0 deletions primed/miscellaneous_workspaces/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def get_api_json_response(
],
"name": workspace,
"namespace": billing_project,
"isLocked": False,
},
}
return json_data
Expand Down Expand Up @@ -388,6 +389,7 @@ def get_api_json_response(
],
"name": workspace,
"namespace": billing_project,
"isLocked": False,
},
}
return json_data
Expand Down Expand Up @@ -610,6 +612,7 @@ def get_api_json_response(
],
"name": workspace,
"namespace": billing_project,
"isLocked": False,
},
}
return json_data
Expand Down Expand Up @@ -831,6 +834,7 @@ def get_api_json_response(
],
"name": workspace,
"namespace": billing_project,
"isLocked": False,
},
}
return json_data
Expand Down Expand Up @@ -1066,6 +1070,7 @@ def get_api_json_response(
],
"name": workspace,
"namespace": billing_project,
"isLocked": False,
},
}
return json_data
Expand Down
6 changes: 6 additions & 0 deletions primed_apps.cron
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# PRIMED_APPS crontab
# nightly except sunday at 01:00
0 1 * * MON-SAT . /var/www/django/primed_apps/primed-apps-activate.sh; python manage.py run_anvil_audit --email [email protected] --errors-only >> cron.log 2>&1

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

# sunday night at 01:00
# 0 1 * * SUN . /var/www/django/primed_apps_dev/primed-apps-dev-activate.sh; python manage.py run_anvil_audit --email [email protected] >> cron.log 2>&1
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ django-dbbackup==4.0.1 # https://github.com/jazzband/django-dbbackup
django-extensions==3.2.1 # https://github.com/django-extensions/django-extensions

# anvil_consortium_manager
git+https://github.com/UW-GAC/django-anvil-consortium-manager.git@v0.12.1
git+https://github.com/UW-GAC/django-anvil-consortium-manager.git@v0.14

# Simple history - model history tracking
django-simple-history==3.1.1
Expand Down

0 comments on commit 4fe583e

Please sign in to comment.