From 09fc776c5f5aebf3b707c80c232183aa7b3387a5 Mon Sep 17 00:00:00 2001 From: Elijah Date: Thu, 4 Jan 2024 21:07:57 +0100 Subject: [PATCH 01/28] Added YAML file for the actual CI Pipeline --- .gitea/workflows/ci-pipeline.yaml | 47 +++++++++++++++++++++++++++++++ .gitea/workflows/demo.yaml | 19 ------------- 2 files changed, 47 insertions(+), 19 deletions(-) create mode 100644 .gitea/workflows/ci-pipeline.yaml delete mode 100644 .gitea/workflows/demo.yaml diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml new file mode 100644 index 0000000..b1ee85b --- /dev/null +++ b/.gitea/workflows/ci-pipeline.yaml @@ -0,0 +1,47 @@ +name: Django CI Pipeline + +on: + push: + branches: + - main + - release + - testing-pipeline + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + + - name: Create virtual environment + run: | + python -m venv venv + source venv/bin/activate + + - name: Install dependencies + run: | + pip install --upgrade pip + pip install -r requirements.txt + + - name: Run makemigrations + run: | + source venv/bin/activate + python manage.py makemigrations + + - name: Run migrate + run: | + source venv/bin/activate + python manage.py migrate + + - name: Run tests + run: | + source venv/bin/activate + python manage.py test + diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml deleted file mode 100644 index 1029150..0000000 --- a/.gitea/workflows/demo.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: Gitea Actions Demo -run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 -on: [push] - -jobs: - Explore-Gitea-Actions: - runs-on: ubuntu-latest - steps: - - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - - name: Check out repository code - uses: actions/checkout@v3 - - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ gitea.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." From ca69df46e40676fa66144fbffd3f48e9331d4b76 Mon Sep 17 00:00:00 2001 From: Elijah Date: Thu, 4 Jan 2024 21:10:33 +0100 Subject: [PATCH 02/28] Fixed Python version to available version --- .gitea/workflows/ci-pipeline.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index b1ee85b..d7572b0 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -18,7 +18,8 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: '3.8' + # Version being used in local development + python-version: '3.10.12' - name: Create virtual environment run: | From 8101a8ceee700a037d744c1b79809a8b6caa8af9 Mon Sep 17 00:00:00 2001 From: Elijah Date: Thu, 4 Jan 2024 21:20:32 +0100 Subject: [PATCH 03/28] Bumped actions versions to latest --- .gitea/workflows/ci-pipeline.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index d7572b0..1a348e2 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -10,16 +10,16 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: # Version being used in local development - python-version: '3.10.12' + python-version: '3.10' - name: Create virtual environment run: | From 6ed33e7ff633e8715496b9f944560a4df8e27e85 Mon Sep 17 00:00:00 2001 From: Elijah Date: Thu, 4 Jan 2024 21:25:18 +0100 Subject: [PATCH 04/28] Testing using default python version --- .gitea/workflows/ci-pipeline.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index 1a348e2..91d7ced 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -10,16 +10,13 @@ on: jobs: build: - runs-on: ubuntu-22.04 + runs-on: self-hosted steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 - with: - # Version being used in local development - python-version: '3.10' - name: Create virtual environment run: | From 5e0b4a708f779ed2aab3387804029858fdef908c Mon Sep 17 00:00:00 2001 From: Elijah Date: Thu, 4 Jan 2024 21:29:26 +0100 Subject: [PATCH 05/28] Changed tag to one recognisable by the runner --- .gitea/workflows/ci-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index 91d7ced..3926b71 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -10,7 +10,7 @@ on: jobs: build: - runs-on: self-hosted + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 61735d5edfeefd2a55aedfcd3e61ab7398682010 Mon Sep 17 00:00:00 2001 From: Elijah Date: Thu, 4 Jan 2024 21:38:21 +0100 Subject: [PATCH 06/28] Manually install Python --- .gitea/workflows/ci-pipeline.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index 3926b71..81092d4 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -15,8 +15,14 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + - name: Install Python + run: | + sudo apt-get update + sudo apt-get install python3 python3-venv python3-pip -y + + - name: Check Python Version + run: | + python3 --version - name: Create virtual environment run: | From 8929408fa558a64724593031631deaf374c1ed22 Mon Sep 17 00:00:00 2001 From: Elijah Date: Tue, 9 Jan 2024 09:58:00 +0100 Subject: [PATCH 07/28] Test setuppython again --- .gitea/workflows/ci-pipeline.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index 81092d4..1189e76 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -10,15 +10,15 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - - name: Install Python - run: | - sudo apt-get update - sudo apt-get install python3 python3-venv python3-pip -y + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" - name: Check Python Version run: | From eae25e8f87cee2662b58c07b0cffe8e4985630b3 Mon Sep 17 00:00:00 2001 From: Elijah Date: Fri, 12 Jan 2024 09:45:34 +0100 Subject: [PATCH 08/28] Check if Python is installed by default --- .gitea/workflows/ci-pipeline.yaml | 34 ++----------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index 1189e76..f1aab5a 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -15,37 +15,7 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - - name: Check Python Version + - name: Check if Python is installed by default run: | - python3 --version - - - name: Create virtual environment - run: | - python -m venv venv - source venv/bin/activate - - - name: Install dependencies - run: | - pip install --upgrade pip - pip install -r requirements.txt - - - name: Run makemigrations - run: | - source venv/bin/activate - python manage.py makemigrations - - - name: Run migrate - run: | - source venv/bin/activate - python manage.py migrate - - - name: Run tests - run: | - source venv/bin/activate - python manage.py test + python3 -c "print('Hi')" From d0ce43a4fa31603a479a6e6afc2b3165763f16b5 Mon Sep 17 00:00:00 2001 From: Elijah Date: Fri, 12 Jan 2024 09:47:44 +0100 Subject: [PATCH 09/28] Run the pipeline from already installed Python3 version --- .gitea/workflows/ci-pipeline.yaml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index f1aab5a..ee87bf1 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -15,7 +15,32 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Check if Python is installed by default + - name: Check if Python is installed run: | - python3 -c "print('Hi')" + python3 -c "print('Python is installed')" + + - name: Create virtual environment + run: | + python3 -m venv venv + source venv/bin/activate + + - name: Install dependencies + run: | + pip install --upgrade pip + pip install -r requirements.txt + + - name: Run makemigrations + run: | + source venv/bin/activate + python manage.py makemigrations + + - name: Run migrate + run: | + source venv/bin/activate + python manage.py migrate + + - name: Run tests + run: | + source venv/bin/activate + python manage.py test From debce902401818cf33dbded04f657fff26f904e4 Mon Sep 17 00:00:00 2001 From: Elijah Date: Fri, 12 Jan 2024 09:49:08 +0100 Subject: [PATCH 10/28] Install python3-venv --- .gitea/workflows/ci-pipeline.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index ee87bf1..1c36264 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -19,6 +19,10 @@ jobs: run: | python3 -c "print('Python is installed')" + - name: Install python3-venv + run: | + apt-get install python3-venv + - name: Create virtual environment run: | python3 -m venv venv From 25456af2e0b73afb622ad974161cf89fe44b399c Mon Sep 17 00:00:00 2001 From: Elijah Date: Fri, 12 Jan 2024 09:51:28 +0100 Subject: [PATCH 11/28] Try installing virtualenv correctly --- .gitea/workflows/ci-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index 1c36264..7b81bcc 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -21,7 +21,7 @@ jobs: - name: Install python3-venv run: | - apt-get install python3-venv + apt-get update && apt-get install python3-virtualenv - name: Create virtual environment run: | From 54c4643739d35c8d7d3d47a408d06f61c155b08b Mon Sep 17 00:00:00 2001 From: Elijah Date: Fri, 12 Jan 2024 09:53:16 +0100 Subject: [PATCH 12/28] Skip confirmation prompt for installing python3-virtualenv --- .gitea/workflows/ci-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index 7b81bcc..b6c4f17 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -21,7 +21,7 @@ jobs: - name: Install python3-venv run: | - apt-get update && apt-get install python3-virtualenv + apt-get update && apt-get install python3-virtualenv -y - name: Create virtual environment run: | From e78ceb6910e01c6485030106beb36a68e04a72f5 Mon Sep 17 00:00:00 2001 From: Elijah Date: Fri, 12 Jan 2024 10:00:13 +0100 Subject: [PATCH 13/28] Try serializing steps for installing py3-venv -> creating venv --- .gitea/workflows/ci-pipeline.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index b6c4f17..8e6005e 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -20,6 +20,7 @@ jobs: python3 -c "print('Python is installed')" - name: Install python3-venv + id: install run: | apt-get update && apt-get install python3-virtualenv -y @@ -27,6 +28,8 @@ jobs: run: | python3 -m venv venv source venv/bin/activate + # https://docs.github.com/en/actions/learn-github-actions/contexts#steps-context + if: steps.install.outcome == 'success' - name: Install dependencies run: | From abd6209fe18c700c4d05e353028e1a6799a51535 Mon Sep 17 00:00:00 2001 From: Elijah Date: Fri, 12 Jan 2024 10:18:14 +0100 Subject: [PATCH 14/28] Add step to check version before trying to create venv --- .gitea/workflows/ci-pipeline.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index 8e6005e..f495e37 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -15,14 +15,15 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Check if Python is installed - run: | - python3 -c "print('Python is installed')" - - name: Install python3-venv id: install run: | - apt-get update && apt-get install python3-virtualenv -y + apt-get update + apt-get install python3 python3-virtualenv python3-pip -y + + - name: Check Python version + run: | + python3 --version - name: Create virtual environment run: | From af600ebdcf333e595f12d417aa390d2e4d40b89c Mon Sep 17 00:00:00 2001 From: Elijah Date: Fri, 12 Jan 2024 10:22:18 +0100 Subject: [PATCH 15/28] Try python3-venv again --- .gitea/workflows/ci-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index f495e37..6e1dc64 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -19,7 +19,7 @@ jobs: id: install run: | apt-get update - apt-get install python3 python3-virtualenv python3-pip -y + apt-get install python3 python3-venv python3-pip -y - name: Check Python version run: | From 1747f0ed910df2e36c3822e08a93c31d2e43e0e5 Mon Sep 17 00:00:00 2001 From: Elijah Date: Fri, 12 Jan 2024 10:25:00 +0100 Subject: [PATCH 16/28] Activated venv on each step --- .gitea/workflows/ci-pipeline.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index 6e1dc64..f89eec5 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -29,11 +29,13 @@ jobs: run: | python3 -m venv venv source venv/bin/activate + echo "Virtual environment created successfully" # https://docs.github.com/en/actions/learn-github-actions/contexts#steps-context if: steps.install.outcome == 'success' - name: Install dependencies run: | + source venv/bin/activate pip install --upgrade pip pip install -r requirements.txt From eab05298506db763a1580c6b5587a69d8ca92e1f Mon Sep 17 00:00:00 2001 From: Elijah Date: Fri, 12 Jan 2024 11:17:18 +0100 Subject: [PATCH 17/28] Limited job to testing --- .gitea/workflows/ci-pipeline.yaml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index f89eec5..bb38125 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -39,16 +39,6 @@ jobs: pip install --upgrade pip pip install -r requirements.txt - - name: Run makemigrations - run: | - source venv/bin/activate - python manage.py makemigrations - - - name: Run migrate - run: | - source venv/bin/activate - python manage.py migrate - - name: Run tests run: | source venv/bin/activate From afe9dc52bdc45e9a6d6e65833462e464eebd5938 Mon Sep 17 00:00:00 2001 From: Elijah Date: Sun, 14 Jan 2024 17:23:49 +0100 Subject: [PATCH 18/28] Added random secret_key generation for test running --- .gitea/workflows/ci-pipeline.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index bb38125..9e4eea2 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -39,6 +39,12 @@ jobs: pip install --upgrade pip pip install -r requirements.txt + - name: Set random secret key + run: | + source venv/bin/activate + SECRET_KEY=$(python3 -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())') + echo $SECRET_KEY > .env + - name: Run tests run: | source venv/bin/activate From 300474f584cd421ada18c130b1056ebe483a61ad Mon Sep 17 00:00:00 2001 From: Elijah Date: Sun, 14 Jan 2024 17:26:04 +0100 Subject: [PATCH 19/28] Check correct key generation --- .gitea/workflows/ci-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index 9e4eea2..c57e972 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -43,7 +43,7 @@ jobs: run: | source venv/bin/activate SECRET_KEY=$(python3 -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())') - echo $SECRET_KEY > .env + echo "${SECRET_KEY}" - name: Run tests run: | From fde3a55586a51ba7a344fa07ae0a41c530e6cb0e Mon Sep 17 00:00:00 2001 From: Elijah Date: Sun, 14 Jan 2024 17:33:35 +0100 Subject: [PATCH 20/28] Test job env-var setting feature --- .gitea/workflows/ci-pipeline.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index c57e972..e014125 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -8,10 +8,13 @@ on: - testing-pipeline jobs: - build: + test: runs-on: ubuntu-22.04 + env: + SECRET_KEY: "t3st_dummy_s3cr3t_k3y" + steps: - uses: actions/checkout@v4 @@ -39,12 +42,6 @@ jobs: pip install --upgrade pip pip install -r requirements.txt - - name: Set random secret key - run: | - source venv/bin/activate - SECRET_KEY=$(python3 -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())') - echo "${SECRET_KEY}" - - name: Run tests run: | source venv/bin/activate From db87a6485acf3e0c135367bd33a69f9b38f72149 Mon Sep 17 00:00:00 2001 From: Elijah Date: Sun, 14 Jan 2024 19:33:31 +0100 Subject: [PATCH 21/28] Try specifying Python version even inside venv --- .gitea/workflows/ci-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index e014125..8da4d4f 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -45,5 +45,5 @@ jobs: - name: Run tests run: | source venv/bin/activate - python manage.py test + python3 manage.py test From 8ef377a61196c6ae1202b53a4cdf24e4720240c8 Mon Sep 17 00:00:00 2001 From: Elijah Date: Sun, 14 Jan 2024 19:38:22 +0100 Subject: [PATCH 22/28] Add subprocess.run fix --- .gitea/workflows/ci-pipeline.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index 8da4d4f..3d5568f 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -45,5 +45,7 @@ jobs: - name: Run tests run: | source venv/bin/activate + # https://stackoverflow.com/questions/61747698/django-error-when-running-server-locally-attributeerror-list-object-has-no + pip uninstall subprocess.run python3 manage.py test From 57538d63208e6f3039ab469f2c4c8f69518fe83f Mon Sep 17 00:00:00 2001 From: Elijah Date: Sun, 14 Jan 2024 19:46:13 +0100 Subject: [PATCH 23/28] Logged Python to ensure correct installation --- .gitea/workflows/ci-pipeline.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index 3d5568f..efb603e 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -27,6 +27,7 @@ jobs: - name: Check Python version run: | python3 --version + echo "Python version: $(python3 --version)" - name: Create virtual environment run: | @@ -45,7 +46,5 @@ jobs: - name: Run tests run: | source venv/bin/activate - # https://stackoverflow.com/questions/61747698/django-error-when-running-server-locally-attributeerror-list-object-has-no - pip uninstall subprocess.run - python3 manage.py test + python manage.py test From 30f17e4132ab0ae40515afb6c7717d7d4482ede4 Mon Sep 17 00:00:00 2001 From: Elijah Date: Sun, 14 Jan 2024 19:57:13 +0100 Subject: [PATCH 24/28] Test to see whether python-decouple is responsible for the errors --- trustchain_idhub/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trustchain_idhub/settings.py b/trustchain_idhub/settings.py index b9eecc5..dc64844 100644 --- a/trustchain_idhub/settings.py +++ b/trustchain_idhub/settings.py @@ -33,7 +33,7 @@ SECRET_KEY = config('SECRET_KEY') DEBUG = config('DEBUG', default=False, cast=bool) DEVELOPMENT = config('DEVELOPMENT', default=False, cast=bool) -ALLOWED_HOSTS = config('ALLOWED_HOSTS', default=[], cast=Csv()) +ALLOWED_HOSTS = config('ALLOWED_HOSTS', default=[]) CSRF_TRUSTED_ORIGINS = config('CSRF_TRUSTED_ORIGINS', default=[], cast=Csv()) DOMAIN = config("DOMAIN", "http://localhost") From 22bbba9c69589a92749839b00a55f1466b133678 Mon Sep 17 00:00:00 2001 From: Elijah Date: Sun, 14 Jan 2024 19:59:09 +0100 Subject: [PATCH 25/28] Test to see whether python-decouple is responsible for the errors --- trustchain_idhub/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trustchain_idhub/settings.py b/trustchain_idhub/settings.py index dc64844..15c1e82 100644 --- a/trustchain_idhub/settings.py +++ b/trustchain_idhub/settings.py @@ -34,7 +34,7 @@ DEBUG = config('DEBUG', default=False, cast=bool) DEVELOPMENT = config('DEVELOPMENT', default=False, cast=bool) ALLOWED_HOSTS = config('ALLOWED_HOSTS', default=[]) -CSRF_TRUSTED_ORIGINS = config('CSRF_TRUSTED_ORIGINS', default=[], cast=Csv()) +CSRF_TRUSTED_ORIGINS = config('CSRF_TRUSTED_ORIGINS', default=[]) DOMAIN = config("DOMAIN", "http://localhost") From 4a0d15c9c2d12f5d5ae4c3bdd434d845e7c3a42d Mon Sep 17 00:00:00 2001 From: Elijah Date: Sun, 14 Jan 2024 20:04:05 +0100 Subject: [PATCH 26/28] Test the gitea actions secrets and variables system --- .gitea/workflows/ci-pipeline.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index efb603e..a7d4441 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -13,7 +13,9 @@ jobs: runs-on: ubuntu-22.04 env: - SECRET_KEY: "t3st_dummy_s3cr3t_k3y" + SECRET_KEY: {{ secrets.SECRET_KEY }} + STATIC_ROOT: {{ vars.STATIC_ROOT }} + MEDIA_ROOT: {{ vars.MEDIA_ROOT }} steps: - uses: actions/checkout@v4 From e3d8ee44f82aec854ed4565e497827c57d5e8fef Mon Sep 17 00:00:00 2001 From: Elijah Date: Sun, 14 Jan 2024 20:12:17 +0100 Subject: [PATCH 27/28] Test the gitea actions secrets and variables system --- .gitea/workflows/ci-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index a7d4441..c3b1695 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-22.04 env: - SECRET_KEY: {{ secrets.SECRET_KEY }} + SECRET_KEY: "t3st-dummy-s3cr3t-k3y" STATIC_ROOT: {{ vars.STATIC_ROOT }} MEDIA_ROOT: {{ vars.MEDIA_ROOT }} From c00f74a186005ec33ab7e4e61aa736dbf28205ca Mon Sep 17 00:00:00 2001 From: Elijah Date: Sun, 14 Jan 2024 20:16:20 +0100 Subject: [PATCH 28/28] Introduce env vars manually --- .gitea/workflows/ci-pipeline.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index c3b1695..44eece3 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -14,8 +14,8 @@ jobs: env: SECRET_KEY: "t3st-dummy-s3cr3t-k3y" - STATIC_ROOT: {{ vars.STATIC_ROOT }} - MEDIA_ROOT: {{ vars.MEDIA_ROOT }} + STATIC_ROOT: "tmp/static/" + MEDIA_ROOT: "tmp/media/" steps: - uses: actions/checkout@v4