-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
253 changed files
with
7,538 additions
and
2,643 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,10 @@ DJANGO_SUPERUSER_USERNAME=admin # do not use in production! | |
DJANGO_SUPERUSER_PASSWORD=admin # do not use in production! | ||
[email protected] # do not use in production! | ||
AML_LOCATION_PROVIDER=http://ip2country:5000/{} # address of the ip2country container, don't change | ||
ALLOWED_HOSTS=localhost # needs to be changed when running in production | ||
AML_ALLOWED_HOSTS="backend.muscle.local" # needs to be changed when running in production | ||
|
||
REACT_APP_API_ROOT=http://localhost:8000 # address of the server, don't change | ||
REACT_APP_EXPERIMENT_SLUG=gmsi # experiment slug that the frontend redirects to | ||
REACT_APP_API_ROOT=http://backend.muscle.local # address of the server, don't change | ||
REACT_APP_EXPERIMENT_SLUG=gold-msi # experiment slug that the frontend redirects to | ||
REACT_APP_AML_HOME=https://www.amsterdammusiclab.nl # website you will be redirected to if you do not agree with an informed consent form | ||
REACT_APP_LOGO_URL= # optional: link to logo | ||
REACT_APP_HTML_PAGE_TITLE=Amsterdam Music Lab Experiment # optional: information for web crawlers | ||
|
@@ -27,3 +27,4 @@ REACT_APP_HTML_OG_TITLE=Amsterdam Music Lab Experiment # optional: information f | |
REACT_APP_HTML_OG_URL= # optional: information for web crawlers | ||
REACT_APP_HTML_BODY_CLASS= # optional: assign a css class to the <body> tag in index.html, for custom styling | ||
REACT_APP_SENTRY_DSN= # optional: link to sentry instance, e.g. https://[email protected]/xxx | ||
REACT_APP_STRICT= # optional: use StrictMode for development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
name: Podman build & deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
workflow_dispatch: | ||
|
||
# temporarily also for PRs | ||
pull_request: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
deploy-test: | ||
name: Deploy to test environment | ||
environment: Test | ||
runs-on: tst | ||
if: github.ref == 'refs/heads/develop' | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
env: | ||
|
||
# Variables | ||
AML_ALLOWED_HOSTS: ${{ vars.AML_ALLOWED_HOSTS }} | ||
AML_CORS_ORIGIN_WHITELIST: ${{ vars.AML_CORS_ORIGIN_WHITELIST }} | ||
AML_DEBUG: ${{ vars.AML_DEBUG }} | ||
AML_LOCATION_PROVIDER: ${{ vars.AML_LOCATION_PROVIDER }} | ||
AML_SUBPATH: ${{ vars.AML_SUBPATH }} | ||
DJANGO_SETTINGS_MODULE: ${{ vars.DJANGO_SETTINGS_MODULE }} | ||
SQL_DATABASE: ${{ vars.SQL_DATABASE }} | ||
SQL_HOST: ${{ vars.SQL_HOST }} | ||
SQL_PORT: ${{ vars.SQL_PORT }} | ||
REACT_APP_API_ROOT: ${{ vars.REACT_APP_API_ROOT }} | ||
REACT_APP_EXPERIMENT_SLUG: ${{ vars.REACT_APP_EXPERIMENT_SLUG }} | ||
REACT_APP_AML_HOME: ${{ vars.REACT_APP_AML_HOME }} | ||
REACT_APP_HTML_PAGE_TITLE: ${{ vars.REACT_APP_HTML_PAGE_TITLE }} | ||
|
||
# Secrets | ||
AML_SECRET_KEY: ${{ secrets.AML_SECRET_KEY }} | ||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | ||
SQL_USER: ${{ secrets.SQL_USER }} | ||
SQL_PASSWORD: ${{ secrets.SQL_PASSWORD }} | ||
REACT_APP_SENTRY_DSN: ${{ secrets.REACT_APP_SENTRY_DSN }} | ||
DJANGO_SUPERUSER_USERNAME: ${{ secrets.DJANGO_SUPERUSER_USERNAME }} | ||
DJANGO_SUPERUSER_PASSWORD: ${{ secrets.DJANGO_SUPERUSER_PASSWORD }} | ||
DJANGO_SUPERUSER_EMAIL: ${{ secrets.DJANGO_SUPERUSER_EMAIL }} | ||
|
||
# Prevent podman services from exiting after startup | ||
RUNNER_TRACKING_ID: "" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Create .env file | ||
run: | | ||
touch .env | ||
echo "REACT_APP_API_ROOT=$REACT_APP_API_ROOT" >> .env | ||
echo "REACT_APP_EXPERIMENT_SLUG=$REACT_APP_EXPERIMENT_SLUG" >> .env | ||
echo "REACT_APP_AML_HOME=$REACT_APP_AML_HOME" >> .env | ||
echo "REACT_APP_HTML_PAGE_TITLE=$REACT_APP_HTML_PAGE_TITLE" >> .env | ||
echo "REACT_APP_SENTRY_DSN=$REACT_APP_SENTRY_DSN" >> .env | ||
cp .env frontend/.env | ||
- name: Build Podman images | ||
run: podman-compose -f docker-compose-deploy.yml build | ||
- name: Deploy Podman images | ||
run: podman-compose -f docker-compose-deploy.yml up -d --force-recreate | ||
- name: Prune old images | ||
run: podman image prune -a -f | ||
- name: Check Podman images | ||
run: podman-compose -f docker-compose-deploy.yml ps | ||
- name: Check logs | ||
run: podman-compose -f docker-compose-deploy.yml logs | ||
|
||
deploy-acceptance: | ||
name: Deploy to acceptance environment | ||
environment: Acceptance | ||
runs-on: ACC | ||
if: github.ref == 'refs/heads/main' || github.ref == 'refs/tags/*' || 1 == 1 # Temporarily always run during testing | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
env: | ||
|
||
# Variables | ||
AML_ALLOWED_HOSTS: ${{ vars.AML_ALLOWED_HOSTS }} | ||
AML_CORS_ORIGIN_WHITELIST: ${{ vars.AML_CORS_ORIGIN_WHITELIST }} | ||
AML_DEBUG: ${{ vars.AML_DEBUG }} | ||
AML_LOCATION_PROVIDER: ${{ vars.AML_LOCATION_PROVIDER }} | ||
AML_SUBPATH: ${{ vars.AML_SUBPATH }} | ||
DJANGO_SETTINGS_MODULE: ${{ vars.DJANGO_SETTINGS_MODULE }} | ||
SQL_DATABASE: ${{ vars.SQL_DATABASE }} | ||
SQL_HOST: ${{ vars.SQL_HOST }} | ||
SQL_PORT: ${{ vars.SQL_PORT }} | ||
REACT_APP_API_ROOT: ${{ vars.REACT_APP_API_ROOT }} | ||
REACT_APP_EXPERIMENT_SLUG: ${{ vars.REACT_APP_EXPERIMENT_SLUG }} | ||
REACT_APP_AML_HOME: ${{ vars.REACT_APP_AML_HOME }} | ||
REACT_APP_HTML_PAGE_TITLE: ${{ vars.REACT_APP_HTML_PAGE_TITLE }} | ||
|
||
# Secrets | ||
AML_SECRET_KEY: ${{ secrets.AML_SECRET_KEY }} | ||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | ||
SQL_USER: ${{ secrets.SQL_USER }} | ||
SQL_PASSWORD: ${{ secrets.SQL_PASSWORD }} | ||
REACT_APP_SENTRY_DSN: ${{ secrets.REACT_APP_SENTRY_DSN }} | ||
DJANGO_SUPERUSER_USERNAME: ${{ secrets.DJANGO_SUPERUSER_USERNAME }} | ||
DJANGO_SUPERUSER_PASSWORD: ${{ secrets.DJANGO_SUPERUSER_PASSWORD }} | ||
DJANGO_SUPERUSER_EMAIL: ${{ secrets.DJANGO_SUPERUSER_EMAIL }} | ||
|
||
# Prevent podman services from exiting after startup | ||
RUNNER_TRACKING_ID: "" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Create .env file | ||
run: | | ||
touch .env | ||
echo "REACT_APP_API_ROOT=$REACT_APP_API_ROOT" >> .env | ||
echo "REACT_APP_EXPERIMENT_SLUG=$REACT_APP_EXPERIMENT_SLUG" >> .env | ||
echo "REACT_APP_AML_HOME=$REACT_APP_AML_HOME" >> .env | ||
echo "REACT_APP_HTML_PAGE_TITLE=$REACT_APP_HTML_PAGE_TITLE" >> .env | ||
echo "REACT_APP_SENTRY_DSN=$REACT_APP_SENTRY_DSN" >> .env | ||
cp .env frontend/.env | ||
- name: Build Podman images | ||
run: podman-compose -f docker-compose-deploy.yml build | ||
- name: Deploy Podman images | ||
run: podman-compose -f docker-compose-deploy.yml up -d --force-recreate | ||
- name: Prune old images | ||
run: podman image prune -a -f | ||
- name: Check Podman images | ||
run: podman-compose -f docker-compose-deploy.yml ps | ||
- name: Check logs | ||
run: podman-compose -f docker-compose-deploy.yml logs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[flake8] | ||
# Flake8 Configuration File | ||
|
||
# High Priority: Security and Correctness | ||
# These issues are critical and should be addressed first. | ||
extend-ignore = | ||
E722, # Do not use bare 'except' | ||
F722, # Syntax error identified by pyflakes | ||
F821, # Undefined name | ||
|
||
# Medium Priority: Code Maintainability and Readability | ||
# Improving these can greatly enhance code readability and maintainability. | ||
E501, # Line too long | ||
F401, # Unused import | ||
F403, # 'from module import *' used; unable to detect undefined names | ||
F405, # Name may be undefined, or defined from star imports | ||
F811, # Redefinition of unused name from line N | ||
F841, # Local variable name is assigned to but never used | ||
|
||
# Low Priority: Style Guide Adherence | ||
# These are mostly about whitespace and indentation, which can be adjusted later. | ||
E201, # Whitespace after '(' | ||
E202, # Whitespace before ')' | ||
E203, # Whitespace before ':' | ||
E222, # Multiple spaces after operator | ||
E225, # Missing whitespace around operator | ||
E231, # Missing whitespace after ',' | ||
E251, # Unexpected spaces around keyword / parameter equals | ||
E262, # Inline comment should start with '# ' | ||
E122, # Continuation line missing indentation or outdented | ||
E124, # Closing bracket does not match visual indentation | ||
E125, # Continuation line with same indent as next logical line | ||
E127, # Continuation line over-indented for visual indent | ||
E128, # Continuation line under-indented for visual indent | ||
E131, # Continuation line unaligned for hanging indent | ||
E261, # At least two spaces before inline comment | ||
W191, # Indentation contains tabs | ||
W291, # Trailing whitespace | ||
W292, # No newline at end of file | ||
W293, # Blank line contains whitespace | ||
W391, # Blank line at end of file | ||
W503, # Line break occurred before a binary operator | ||
|
||
# General Configuration | ||
max-line-length = 120 | ||
exclude = .venv, .git, __pycache__, build, dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
FROM python:3.8 | ||
FROM docker.io/python:3.8 as base | ||
ENV PYTHONUNBUFFERED 1 | ||
RUN apt-get -y update | ||
RUN apt-get install -y ffmpeg | ||
|
||
WORKDIR /server | ||
COPY requirements/dev.txt /server/ | ||
RUN pip install -r dev.txt | ||
|
||
RUN pip install -r dev.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.