From cde87463ddf1b87529a59afa71395226d2d99ac6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 May 2023 21:39:48 +0000 Subject: [PATCH 01/60] Bump django from 4.2 to 4.2.1 in /requirements Bumps [django](https://github.com/django/django) from 4.2 to 4.2.1. - [Commits](https://github.com/django/django/compare/4.2...4.2.1) --- updated-dependencies: - dependency-name: django dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index 5345760..cdc52bd 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -8,7 +8,7 @@ asgiref==3.6.0 # via django dj-database-url==1.3.0 # via -r requirements-dev.in -django==4.2 +django==4.2.1 # via # -r requirements-dev.in # dj-database-url From fcc6e08e491392b7ff17dab388bc7ba7fdaed10e Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Fri, 16 Jun 2023 17:17:01 -0300 Subject: [PATCH 02/60] Add health-check --- Dockerfile | 3 +++ README.rst | 4 ++-- coleman/settings.py | 1 + coleman/urls.py | 1 + requirements/requirements-dev.in | 1 + requirements/requirements-dev.txt | 3 +++ 6 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7be9b26..c4c66da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -76,4 +76,7 @@ RUN honcho start collectstatic compilemessages \ USER worker +HEALTHCHECK --interval=20s --timeout=3s \ + CMD curl -f http://localhost:8000/health/?format=json || exit 1 + CMD ["sh", "-c", "exec honcho start --no-prefix $PROCESS_TYPE"] diff --git a/README.rst b/README.rst index a964fa8..5d104b5 100644 --- a/README.rst +++ b/README.rst @@ -168,7 +168,7 @@ to the Postgres container so even executing ``docker compose down`` won't delete the data, but if you want to start from scratch:: $ docker compose down - $ docker volume rm pg-coleman_data + $ docker volume rm django-coleman_data Add changes in the code ^^^^^^^^^^^^^^^^^^^^^^^ @@ -178,7 +178,7 @@ When adding changes in the code, the image needs to be updated:: $ docker compose build Then run again. A script ``docker-build.sh`` with more advance -features and without using docker-compose is also provided +features and without using docker compose is also provided to re-build the image. diff --git a/coleman/settings.py b/coleman/settings.py index 7bad842..0debcbf 100644 --- a/coleman/settings.py +++ b/coleman/settings.py @@ -48,6 +48,7 @@ 'django.contrib.messages', 'django.contrib.staticfiles', 'django_extensions', + 'health_check', ] REST_ENABLED = env.bool('REST_ENABLED', False) diff --git a/coleman/urls.py b/coleman/urls.py index 129667e..85ba623 100644 --- a/coleman/urls.py +++ b/coleman/urls.py @@ -35,6 +35,7 @@ urlpatterns = [ re_path(r'^$', lambda r: HttpResponseRedirect('admin/')), # Remove this redirect if you add custom views path('admin/', admin.site.urls), + re_path(r'^health/', include('health_check.urls')), ] + urlpatterns admin.site.site_title = admin.site.site_header = settings.SITE_HEADER diff --git a/requirements/requirements-dev.in b/requirements/requirements-dev.in index 9e1128a..b3b04f7 100644 --- a/requirements/requirements-dev.in +++ b/requirements/requirements-dev.in @@ -5,3 +5,4 @@ django-admin-list-filter-dropdown~=1.0.3 django-adminfilters~=2.1.0 djangorestframework~=3.14.0 django-extensions~=3.2.1 +django-health-check~=3.17.0 diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index cdc52bd..f4d4ab9 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -13,6 +13,7 @@ django==4.2.1 # -r requirements-dev.in # dj-database-url # django-extensions + # django-health-check # djangorestframework django-admin-list-filter-dropdown==1.0.3 # via -r requirements-dev.in @@ -20,6 +21,8 @@ django-adminfilters==2.1.0 # via -r requirements-dev.in django-extensions==3.2.1 # via -r requirements-dev.in +django-health-check==3.17.0 + # via -r requirements-dev.in djangorestframework==3.14.0 # via -r requirements-dev.in environs==9.5.0 From 86e21b4abe5c81c168de6413103600e7cd2d837b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Jul 2023 22:52:30 +0000 Subject: [PATCH 03/60] Bump django from 4.2.1 to 4.2.3 in /requirements Bumps [django](https://github.com/django/django) from 4.2.1 to 4.2.3. - [Commits](https://github.com/django/django/compare/4.2.1...4.2.3) --- updated-dependencies: - dependency-name: django dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index f4d4ab9..253c3a1 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -8,7 +8,7 @@ asgiref==3.6.0 # via django dj-database-url==1.3.0 # via -r requirements-dev.in -django==4.2.1 +django==4.2.3 # via # -r requirements-dev.in # dj-database-url From a6eb132395835bd625676d138281979b3ab7c33b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 20:20:59 +0000 Subject: [PATCH 04/60] Bump uwsgi from 2.0.21 to 2.0.22 in /requirements Bumps [uwsgi](https://github.com/unbit/uwsgi-docs) from 2.0.21 to 2.0.22. - [Commits](https://github.com/unbit/uwsgi-docs/commits) --- updated-dependencies: - dependency-name: uwsgi dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements/requirements-prod.in | 2 +- requirements/requirements-prod.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/requirements-prod.in b/requirements/requirements-prod.in index 0dac448..d1bf821 100644 --- a/requirements/requirements-prod.in +++ b/requirements/requirements-prod.in @@ -1,4 +1,4 @@ # Web server -uWSGI~=2.0.21 +uWSGI~=2.0.22 # PosgreSQL driver psycopg[binary]~=3.1.8 diff --git a/requirements/requirements-prod.txt b/requirements/requirements-prod.txt index 380ab6a..0174f24 100644 --- a/requirements/requirements-prod.txt +++ b/requirements/requirements-prod.txt @@ -10,5 +10,5 @@ psycopg-binary==3.1.8 # via psycopg typing-extensions==4.5.0 # via psycopg -uwsgi==2.0.21 +uwsgi==2.0.22 # via -r requirements-prod.in From 5b5255e3d49c617f20edf30a15581fcf790f63df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Nov 2023 21:50:19 +0000 Subject: [PATCH 05/60] Bump django from 4.2.3 to 4.2.7 in /requirements Bumps [django](https://github.com/django/django) from 4.2.3 to 4.2.7. - [Commits](https://github.com/django/django/compare/4.2.3...4.2.7) --- updated-dependencies: - dependency-name: django dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index 253c3a1..f940d14 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -8,7 +8,7 @@ asgiref==3.6.0 # via django dj-database-url==1.3.0 # via -r requirements-dev.in -django==4.2.3 +django==4.2.7 # via # -r requirements-dev.in # dj-database-url From 0e86dd4646bdd9a078b51016d8f03b3ece5d0c4a Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Thu, 18 Jan 2024 10:34:24 -0300 Subject: [PATCH 06/60] Compose: DB healthcheck --- compose.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/compose.yml b/compose.yml index 17717a6..fbeb79e 100644 --- a/compose.yml +++ b/compose.yml @@ -38,16 +38,23 @@ services: - ADMIN_USERNAME - ADMIN_PASSWORD depends_on: - - postgres + postgres: + condition: service_healthy postgres: image: postgres:15 environment: - POSTGRES_PASSWORD=postgres + - PGUSER=postgres ports: - "5432:5432" volumes: - data:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready"] + interval: 1s + timeout: 3s + retries: 5 command: ["postgres", "-c", "log_statement=all"] # Comment to disable SQL logs. all: all queries, ddl: DDL only, mod: DDL and modifying statements django-coleman-mtasks-viewer: @@ -87,7 +94,8 @@ services: - ADMIN_USERNAME - ADMIN_PASSWORD depends_on: - - postgres + postgres: + condition: service_healthy profiles: - tools @@ -107,7 +115,8 @@ services: - POSTGRES_PASSWORD - DATABASE_URL depends_on: - - postgres + postgres: + condition: service_healthy profiles: - tools @@ -118,7 +127,8 @@ services: - DATABASE_URL - LOG_LEVEL_DJANGO_DB=INFO depends_on: - - postgres + postgres: + condition: service_healthy profiles: - tools @@ -131,7 +141,8 @@ services: - ADMIN_PASSWORD - LOG_LEVEL_DJANGO_DB=INFO depends_on: - - postgres + postgres: + condition: service_healthy profiles: - tools From fc13ab308e6298017e497a351a3cf55bbe221f92 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Thu, 18 Jan 2024 11:38:37 -0300 Subject: [PATCH 07/60] Compose: root name --- compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compose.yml b/compose.yml index fbeb79e..447fda5 100644 --- a/compose.yml +++ b/compose.yml @@ -1,3 +1,5 @@ +name: coleman + volumes: data: # Volume name listed: django-coleman_data driver: local From 0b4d0a076806686ac3dd7565a9b383e073f1f68a Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Thu, 18 Jan 2024 11:41:57 -0300 Subject: [PATCH 08/60] Pytest opts --- pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index 176c25e..8a80708 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,7 +1,7 @@ [pytest] DJANGO_SETTINGS_MODULE = coleman.settings_test -addopts = --create-db +addopts = --create-db -rfExXs filterwarnings = ignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning From 99332258af4af57d133c5518e1850d1e9bc56377 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Feb 2024 18:19:42 +0000 Subject: [PATCH 09/60] Bump django from 4.2.7 to 4.2.10 in /requirements Bumps [django](https://github.com/django/django) from 4.2.7 to 4.2.10. - [Commits](https://github.com/django/django/compare/4.2.7...4.2.10) --- updated-dependencies: - dependency-name: django dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index f940d14..54f5a63 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -8,7 +8,7 @@ asgiref==3.6.0 # via django dj-database-url==1.3.0 # via -r requirements-dev.in -django==4.2.7 +django==4.2.10 # via # -r requirements-dev.in # dj-database-url From e9759d678c1607b4eef566156bc574559673081d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 20:51:48 +0000 Subject: [PATCH 10/60] Bump django from 4.2.10 to 4.2.11 in /requirements Bumps [django](https://github.com/django/django) from 4.2.10 to 4.2.11. - [Commits](https://github.com/django/django/compare/4.2.10...4.2.11) --- updated-dependencies: - dependency-name: django dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index 54f5a63..ab51d2f 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -8,7 +8,7 @@ asgiref==3.6.0 # via django dj-database-url==1.3.0 # via -r requirements-dev.in -django==4.2.10 +django==4.2.11 # via # -r requirements-dev.in # dj-database-url From 9e2db1c313b9dd2f1cff91261e3ca0ddaa7e2945 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 22:56:14 +0000 Subject: [PATCH 11/60] Bump sqlparse from 0.4.4 to 0.5.0 in /requirements Bumps [sqlparse](https://github.com/andialbrecht/sqlparse) from 0.4.4 to 0.5.0. - [Changelog](https://github.com/andialbrecht/sqlparse/blob/master/CHANGELOG) - [Commits](https://github.com/andialbrecht/sqlparse/compare/0.4.4...0.5.0) --- updated-dependencies: - dependency-name: sqlparse dependency-type: indirect ... Signed-off-by: dependabot[bot] --- requirements/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index ab51d2f..d58bcad 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -33,7 +33,7 @@ python-dotenv==0.19.2 # via environs pytz==2022.1 # via djangorestframework -sqlparse==0.4.4 +sqlparse==0.5.0 # via django typing-extensions==4.5.0 # via dj-database-url From 35dc349a27c4c4dc1c2c329f432fd25ad94f1bcf Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Wed, 17 Apr 2024 09:42:51 -0300 Subject: [PATCH 12/60] Provision task can run more than once without fail --- Procfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Procfile b/Procfile index f24bbd1..d626fed 100644 --- a/Procfile +++ b/Procfile @@ -6,5 +6,5 @@ compilemessages: ./manage.py compilemessages --ignore 'venv*' --ignore '.venv*' migrate: ./manage.py showmigrations && ./manage.py migrate makemigrations: ./manage.py makemigrations && ./manage.py makemigrations partner mtasks createadmin: ./manage.py shell -c "from django.contrib.auth.models import User; User.objects.create_superuser('$ADMIN_USERNAME', password='$ADMIN_PASSWORD')" && printf "User \"$ADMIN_USERNAME\" created.\n---> DON'T forget to CHANGE the password <---\n" -provision: honcho start createdb && honcho start migrate && honcho start createadmin +provision: honcho start createdb && honcho start migrate && honcho start createadmin || true test: pytest --cov --cov-report=html --cov-report=term-missing --no-cov-on-fail --color=yes From 2c86b71182efb6448ef633a03581270a403eda76 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Wed, 17 Apr 2024 09:43:32 -0300 Subject: [PATCH 13/60] Build the right image in CI --- .github/workflows/docker-image.yml | 7 ++++--- Dockerfile | 2 +- docker-build.sh | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 8b8e3db..9c48fc4 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,16 +1,17 @@ name: Docker Image CI -on: [push, pull_request] +on: [push] jobs: build: + name: Build & Test runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Build the Docker image - run: ./docker-build.sh + run: ./docker-build.sh "${GITHUB_REF#refs/heads/}" - name: Run tests - run: docker run --rm -e PROCESS_TYPE=test --name django-coleman mrsarm/django-coleman + run: docker run --rm -e PROCESS_TYPE=test --name django-coleman "mrsarm/django-coleman:${GITHUB_REF#refs/heads/}" diff --git a/Dockerfile b/Dockerfile index c4c66da..9df4fdd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-slim +FROM python:3.11-slim-bookworm LABEL maintainer="Mariano Ruiz " ENV CXXFLAGS="-mtune=intel -Os -pipe" \ diff --git a/docker-build.sh b/docker-build.sh index 04984b7..730617d 100755 --- a/docker-build.sh +++ b/docker-build.sh @@ -19,5 +19,7 @@ GIT_HASH_SHORT=$(git rev-parse --short "$GIT_HASH") export BUILD=${GIT_BRANCH}.${GIT_HASH_SHORT} echo "Building mrsarm/django-coleman:${TAG} with image_build $BUILD ..." + +set -x #docker-compose build docker build --build-arg=BUILD="$BUILD" -t mrsarm/django-coleman:${TAG} . From 99fd0c9a2dc77ea68b0eb0c3d146d416e1de778f Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Wed, 17 Apr 2024 17:22:42 -0300 Subject: [PATCH 14/60] Publish docker image from CI --- .github/workflows/docker-image.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 9c48fc4..3977242 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -11,7 +11,14 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build the Docker image run: ./docker-build.sh "${GITHUB_REF#refs/heads/}" - name: Run tests run: docker run --rm -e PROCESS_TYPE=test --name django-coleman "mrsarm/django-coleman:${GITHUB_REF#refs/heads/}" + - name: Push Docker image + run: docker push "mrsarm/django-coleman:${GITHUB_REF#refs/heads/}" From c684d49c3a3ddea33de011db37eb62ad37e06dba Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Wed, 17 Apr 2024 17:27:37 -0300 Subject: [PATCH 15/60] Slug version of branch for tag --- .github/workflows/docker-image.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 3977242..75aa4d1 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -11,14 +11,16 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Inject slug/short variables + uses: rlespinasse/github-slug-action@v4 - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build the Docker image - run: ./docker-build.sh "${GITHUB_REF#refs/heads/}" + run: ./docker-build.sh "${GITHUB_REF_SLUG}" - name: Run tests - run: docker run --rm -e PROCESS_TYPE=test --name django-coleman "mrsarm/django-coleman:${GITHUB_REF#refs/heads/}" + run: docker run --rm -e PROCESS_TYPE=test --name django-coleman "mrsarm/django-coleman:${GITHUB_REF_SLUG}" - name: Push Docker image - run: docker push "mrsarm/django-coleman:${GITHUB_REF#refs/heads/}" + run: docker push "mrsarm/django-coleman:${GITHUB_REF_SLUG}" From 52856c08f5cc243b56e5c47581c33cf45417c397 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Wed, 17 Apr 2024 17:56:15 -0300 Subject: [PATCH 16/60] Release latest on master --- .github/workflows/docker-image.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 75aa4d1..bd29ca5 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -24,3 +24,9 @@ jobs: run: docker run --rm -e PROCESS_TYPE=test --name django-coleman "mrsarm/django-coleman:${GITHUB_REF_SLUG}" - name: Push Docker image run: docker push "mrsarm/django-coleman:${GITHUB_REF_SLUG}" + - name: Tag "latest" + if: ${{ github.ref == 'refs/heads/master' }} + run: docker tag "mrsarm/django-coleman:${GITHUB_REF_SLUG}" mrsarm/django-coleman:latest + - name: Release "latest" + if: ${{ github.ref == 'refs/heads/master' }} + run: docker push mrsarm/django-coleman:latest From 54e643a388be7c3ed25b82fbd36ac3c2650b1ab3 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Wed, 17 Apr 2024 18:09:12 -0300 Subject: [PATCH 17/60] Don't release "master" image --- .github/workflows/docker-image.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index bd29ca5..61fed99 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -22,7 +22,8 @@ jobs: run: ./docker-build.sh "${GITHUB_REF_SLUG}" - name: Run tests run: docker run --rm -e PROCESS_TYPE=test --name django-coleman "mrsarm/django-coleman:${GITHUB_REF_SLUG}" - - name: Push Docker image + - name: Release Docker image + if: ${{ github.ref != 'refs/heads/master' }} run: docker push "mrsarm/django-coleman:${GITHUB_REF_SLUG}" - name: Tag "latest" if: ${{ github.ref == 'refs/heads/master' }} From 0684702e5c16ff60bf06a947d5f924d2c2b55274 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Wed, 17 Apr 2024 18:17:12 -0300 Subject: [PATCH 18/60] Fix CI pipeline for master / latest --- .github/workflows/docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 61fed99..21898d3 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -4,8 +4,8 @@ on: [push] jobs: - build: - name: Build & Test + build-test-release: + name: Build, Test and Release runs-on: ubuntu-latest From dfb3fb0d4af2736552acc6e253edfaa5fa485161 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Wed, 17 Apr 2024 18:19:13 -0300 Subject: [PATCH 19/60] Fix CI pipeline --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 21898d3..a52c236 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -16,7 +16,7 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} + username: ${{ env.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build the Docker image run: ./docker-build.sh "${GITHUB_REF_SLUG}" From 7009c584a15608c92ebd0e64fb9b8fab3341efe5 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Wed, 17 Apr 2024 18:32:57 -0300 Subject: [PATCH 20/60] Fix CI pipeline again --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index a52c236..b635955 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -16,7 +16,7 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 with: - username: ${{ env.DOCKERHUB_USERNAME }} + username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build the Docker image run: ./docker-build.sh "${GITHUB_REF_SLUG}" From a467ad5f14c44326fcf67b75efd70f47282054b6 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Fri, 19 Apr 2024 19:08:31 -0300 Subject: [PATCH 21/60] Run e2e tests from CI --- .env.example | 25 ----- .github/workflows/docker-image.yml | 31 ++++++ .gitignore | 2 + compose.yml | 159 ----------------------------- 4 files changed, 33 insertions(+), 184 deletions(-) delete mode 100644 .env.example delete mode 100644 compose.yml diff --git a/.env.example b/.env.example deleted file mode 100644 index be6a950..0000000 --- a/.env.example +++ /dev/null @@ -1,25 +0,0 @@ -PYTHONUNBUFFERED=1 -DEBUG=true -DATABASE_URL=postgresql://dcoleman:postgres@postgres/dcoleman_dev -POSTGRES_PASSWORD=postgres -LANGUAGE_CODE=en -PORT=8000 -REST_ENABLED=true -SECRET_KEY=f*)$)fay97180m+ti%xi8si##u__h(8%(ipr1z-*lsjbucooz& -LOG_LEVEL=INFO -LOG_LEVEL_DJANGO=INFO -LOG_LEVEL_DJANGO_DB=INFO -LOG_LEVEL_DJANGO_REQ=INFO -EMAIL_HOST_USER=YOUREMAIL@gmail.com -EMAIL_HOST_PASSWORD=PASS -EMAIL_BACKEND=django.core.mail.backends.console.EmailBackend -TASKS_SEND_EMAILS_TO_ASSIGNED=true -TASKS_SEND_EMAILS_TO_PARTNERS=true -TASKS_VIEWER_ENABLED=true -AUTH_PASSWORD_VALIDATORS_ENABLED=false -APP_EMAIL=no-reply@localhost -APP_NAME=Django Coleman -SITE_HEADER=Django Coleman - A Simple Task Manager -ADMIN_USERNAME=admin -ADMIN_PASSWORD=admin1234 -DCOLEMAN_ENDPOINT=http://django-coleman:8000/api/v1 diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index b635955..ea31c5a 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -25,6 +25,37 @@ jobs: - name: Release Docker image if: ${{ github.ref != 'refs/heads/master' }} run: docker push "mrsarm/django-coleman:${GITHUB_REF_SLUG}" + + - name: Get GitHub downloader + run: wget https://gist.github.com/mrsarm/95279381f3d8bf4269499fb437888e2c/raw/github-file.sh + - name: Get compose.yaml + env: + TOKEN: ${{ secrets.repo_token }} + run: bash ./github-file.sh compose.yaml mrsarm/dcoleman-e2e $GITHUB_REF_SLUG main $TOKEN + - name: Get .env.example + env: + TOKEN: ${{ secrets.repo_token }} + run: bash ./github-file.sh .env.example mrsarm/dcoleman-e2e $GITHUB_REF_SLUG main $TOKEN + + - name: Setup environment variables + run: cp .env.example .env + - name: Download pose + if: ${{ github.ref != 'refs/heads/master' }} + run: wget https://github.com/mrsarm/pose/releases/download/0.4.0-b4/pose-0.4.0-b4-x86_64-unknown-linux-gnu.tar.gz + - name: Unpack pose + if: ${{ github.ref != 'refs/heads/master' }} + run: tar -xvf pose*.tar.gz + - name: Build compose file for CI with pose + if: ${{ github.ref != 'refs/heads/master' }} + run: ./pose --no-docker config --tag "${GITHUB_REF_SLUG}" --tag-filter regex=mrsarm/ --progress -o ci.yaml + - name: Create compose file for CI without pose + if: ${{ github.ref == 'refs/heads/master' }} + run: cp compose.yaml ci.yaml + - name: Pull images + run: docker compose -f ci.yaml pull + - name: Run e2e tests + run: docker compose -f ci.yaml run dcoleman-e2e + - name: Tag "latest" if: ${{ github.ref == 'refs/heads/master' }} run: docker tag "mrsarm/django-coleman:${GITHUB_REF_SLUG}" mrsarm/django-coleman:latest diff --git a/.gitignore b/.gitignore index 8ceea19..e3c8b5d 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,5 @@ venv*/ /htmlcov /.coverage + +ci*.yaml diff --git a/compose.yml b/compose.yml deleted file mode 100644 index 447fda5..0000000 --- a/compose.yml +++ /dev/null @@ -1,159 +0,0 @@ -name: coleman - -volumes: - data: # Volume name listed: django-coleman_data - driver: local - -services: - django-coleman: - image: "mrsarm/django-coleman:${TAG:-latest}" - build: - context: . - args: - - BUILD - ports: - - "8000:8000" - environment: - # Set the values in an .env file or here - - PYTHONUNBUFFERED - - DEBUG - - DATABASE_URL - - POSTGRES_PASSWORD - - LANGUAGE_CODE - - PORT - - REST_ENABLED - - SECRET_KEY - - LOG_LEVEL - - LOG_LEVEL_DJANGO - - LOG_LEVEL_DJANGO_DB - - LOG_LEVEL_DJANGO_REQ - - EMAIL_HOST_USER - - EMAIL_HOST_PASSWORD - - EMAIL_BACKEND - - TASKS_SEND_EMAILS_TO_ASSIGNED - - TASKS_SEND_EMAILS_TO_PARTNERS - - TASKS_VIEWER_ENABLED - - AUTH_PASSWORD_VALIDATORS_ENABLED - - APP_EMAIL - - APP_NAME - - SITE_HEADER - - ADMIN_USERNAME - - ADMIN_PASSWORD - depends_on: - postgres: - condition: service_healthy - - postgres: - image: postgres:15 - environment: - - POSTGRES_PASSWORD=postgres - - PGUSER=postgres - ports: - - "5432:5432" - volumes: - - data:/var/lib/postgresql/data - healthcheck: - test: ["CMD-SHELL", "pg_isready"] - interval: 1s - timeout: 3s - retries: 5 - command: ["postgres", "-c", "log_statement=all"] # Comment to disable SQL logs. all: all queries, ddl: DDL only, mod: DDL and modifying statements - - django-coleman-mtasks-viewer: - image: "mrsarm/django-coleman-mtasks-viewer" - ports: - - "8888:8888" - environment: - - PORT=8888 - - DCOLEMAN_ENDPOINT - - DCOLEMAN_TASKS_VIEWER_HASH_SALT - - DCOLEMAN_MASTER_TOKEN - depends_on: - - django-coleman - - # - # **tools** profile, none of these services runs on startup by default, - # and all are commands that exit once the task finished - # - - - psql: - image: postgres:15 - command: psql postgres -h postgres -U postgres - depends_on: - - postgres - profiles: - - tools - - - # Provide all the DB resources: DB and DB user creation, DB migrations and admin user creation - django-coleman-provision: - image: "mrsarm/django-coleman:${TAG:-latest}" - environment: - - PROCESS_TYPE=provision - - POSTGRES_PASSWORD - - DATABASE_URL - - ADMIN_USERNAME - - ADMIN_PASSWORD - depends_on: - postgres: - condition: service_healthy - profiles: - - tools - - - # One by one provision tasks - # - # Useful in case you only need to run one, e.g. to - # create a new administrator user "john", you would - # normally run `docker-compose up' first to launch - # all the apps, and then in another terminal: - # `ADMIN_USERNAME=john ADMIN_PASSWORD=secretpass docker-compose up django-coleman-createadmin' - - django-coleman-createdb: - image: "mrsarm/django-coleman:${TAG:-latest}" - environment: - - PROCESS_TYPE=createdb - - POSTGRES_PASSWORD - - DATABASE_URL - depends_on: - postgres: - condition: service_healthy - profiles: - - tools - - django-coleman-migrate: - image: "mrsarm/django-coleman:${TAG:-latest}" - environment: - - PROCESS_TYPE=migrate - - DATABASE_URL - - LOG_LEVEL_DJANGO_DB=INFO - depends_on: - postgres: - condition: service_healthy - profiles: - - tools - - django-coleman-createadmin: - image: "mrsarm/django-coleman:${TAG:-latest}" - environment: - - PROCESS_TYPE=createadmin - - DATABASE_URL - - ADMIN_USERNAME - - ADMIN_PASSWORD - - LOG_LEVEL_DJANGO_DB=INFO - depends_on: - postgres: - condition: service_healthy - profiles: - - tools - - - # Run automated tests - - django-coleman-test: - image: "mrsarm/django-coleman:${TAG:-latest}" - environment: - - PROCESS_TYPE=test - profiles: - - tools From 8c5adacf6d84e761ed2efb3a3908f8732468fde7 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Fri, 19 Apr 2024 19:16:54 -0300 Subject: [PATCH 22/60] Fix downloader --- .github/workflows/docker-image.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index ea31c5a..6c5d13e 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -13,6 +13,18 @@ jobs: - uses: actions/checkout@v2 - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 + + - name: Get GitHub downloader + run: wget https://gist.github.com/mrsarm/95279381f3d8bf4269499fb437888e2c/raw/github-file.sh + - name: Get compose.yaml + env: + TOKEN: ${{ secrets.repo_token }} + run: bash ./github-file.sh compose.yaml mrsarm/dcoleman-e2e $GITHUB_REF_SLUG main $TOKEN + - name: Get .env.example + env: + TOKEN: ${{ secrets.repo_token }} + run: bash ./github-file.sh .env.example mrsarm/dcoleman-e2e $GITHUB_REF_SLUG main $TOKEN + - name: Login to Docker Hub uses: docker/login-action@v3 with: @@ -26,17 +38,6 @@ jobs: if: ${{ github.ref != 'refs/heads/master' }} run: docker push "mrsarm/django-coleman:${GITHUB_REF_SLUG}" - - name: Get GitHub downloader - run: wget https://gist.github.com/mrsarm/95279381f3d8bf4269499fb437888e2c/raw/github-file.sh - - name: Get compose.yaml - env: - TOKEN: ${{ secrets.repo_token }} - run: bash ./github-file.sh compose.yaml mrsarm/dcoleman-e2e $GITHUB_REF_SLUG main $TOKEN - - name: Get .env.example - env: - TOKEN: ${{ secrets.repo_token }} - run: bash ./github-file.sh .env.example mrsarm/dcoleman-e2e $GITHUB_REF_SLUG main $TOKEN - - name: Setup environment variables run: cp .env.example .env - name: Download pose From c6c43a9afa6c2f8ab5bd55e5af4eb5abbf62f8e0 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Fri, 19 Apr 2024 19:20:16 -0300 Subject: [PATCH 23/60] Fix downloader token --- .github/workflows/docker-image.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 6c5d13e..0f97341 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -18,12 +18,12 @@ jobs: run: wget https://gist.github.com/mrsarm/95279381f3d8bf4269499fb437888e2c/raw/github-file.sh - name: Get compose.yaml env: - TOKEN: ${{ secrets.repo_token }} - run: bash ./github-file.sh compose.yaml mrsarm/dcoleman-e2e $GITHUB_REF_SLUG main $TOKEN + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: bash ./github-file.sh compose.yaml mrsarm/dcoleman-e2e $GITHUB_REF_SLUG main $GITHUB_TOKEN - name: Get .env.example env: - TOKEN: ${{ secrets.repo_token }} - run: bash ./github-file.sh .env.example mrsarm/dcoleman-e2e $GITHUB_REF_SLUG main $TOKEN + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: bash ./github-file.sh .env.example mrsarm/dcoleman-e2e $GITHUB_REF_SLUG main $GITHUB_TOKEN - name: Login to Docker Hub uses: docker/login-action@v3 From 82faa4c16da07dd84a836f9b28d5996c1ca4c9a7 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Fri, 19 Apr 2024 19:27:18 -0300 Subject: [PATCH 24/60] Fix downloader order --- .github/workflows/docker-image.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 0f97341..6026c6f 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -14,22 +14,12 @@ jobs: - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 - - name: Get GitHub downloader - run: wget https://gist.github.com/mrsarm/95279381f3d8bf4269499fb437888e2c/raw/github-file.sh - - name: Get compose.yaml - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: bash ./github-file.sh compose.yaml mrsarm/dcoleman-e2e $GITHUB_REF_SLUG main $GITHUB_TOKEN - - name: Get .env.example - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: bash ./github-file.sh .env.example mrsarm/dcoleman-e2e $GITHUB_REF_SLUG main $GITHUB_TOKEN - - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build the Docker image run: ./docker-build.sh "${GITHUB_REF_SLUG}" - name: Run tests @@ -38,6 +28,17 @@ jobs: if: ${{ github.ref != 'refs/heads/master' }} run: docker push "mrsarm/django-coleman:${GITHUB_REF_SLUG}" + - name: Get GitHub downloader + run: wget https://gist.github.com/mrsarm/95279381f3d8bf4269499fb437888e2c/raw/github-file.sh + - name: Get compose.yaml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: bash ./github-file.sh compose.yaml mrsarm/dcoleman-e2e $GITHUB_REF_SLUG main $GITHUB_TOKEN + - name: Get .env.example + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: bash ./github-file.sh .env.example mrsarm/dcoleman-e2e $GITHUB_REF_SLUG main $GITHUB_TOKEN + - name: Setup environment variables run: cp .env.example .env - name: Download pose From 1b3f7ccca4bb96ed0db87553f1f409db3a60e973 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Fri, 19 Apr 2024 19:27:48 -0300 Subject: [PATCH 25/60] Rename CI workflow --- .github/workflows/{docker-image.yml => e2e.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{docker-image.yml => e2e.yml} (100%) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/e2e.yml similarity index 100% rename from .github/workflows/docker-image.yml rename to .github/workflows/e2e.yml From 2950c2b3ef569042a7ba167183e427b208a125bd Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Wed, 24 Apr 2024 17:24:31 -0300 Subject: [PATCH 26/60] Download compose config with new pose --- .github/workflows/e2e.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 6026c6f..a26d6db 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -28,28 +28,31 @@ jobs: if: ${{ github.ref != 'refs/heads/master' }} run: docker push "mrsarm/django-coleman:${GITHUB_REF_SLUG}" - - name: Get GitHub downloader - run: wget https://gist.github.com/mrsarm/95279381f3d8bf4269499fb437888e2c/raw/github-file.sh + - name: Download pose + run: wget https://github.com/mrsarm/pose/releases/download/0.4.0-b5/pose-0.4.0-b5-x86_64-unknown-linux-gnu.tar.gz + - name: Unpack pose + run: tar -xvf pose*.tar.gz - name: Get compose.yaml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: bash ./github-file.sh compose.yaml mrsarm/dcoleman-e2e $GITHUB_REF_SLUG main $GITHUB_TOKEN + run: | + ./pose get -H "Authorization: token $GITHUB_TOKEN" \ + "https://raw.githubusercontent.com/mrsarm/dcoleman-e2e/$GITHUB_REF_SLUG/compose.yaml" \ + "$GITHUB_REF_SLUG:main" - name: Get .env.example env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: bash ./github-file.sh .env.example mrsarm/dcoleman-e2e $GITHUB_REF_SLUG main $GITHUB_TOKEN + run: | + ./pose get -H "Authorization: token $GITHUB_TOKEN" \ + "https://raw.githubusercontent.com/mrsarm/dcoleman-e2e/$GITHUB_REF_SLUG/.env.example" \ + "$GITHUB_REF_SLUG:main" - name: Setup environment variables run: cp .env.example .env - - name: Download pose - if: ${{ github.ref != 'refs/heads/master' }} - run: wget https://github.com/mrsarm/pose/releases/download/0.4.0-b4/pose-0.4.0-b4-x86_64-unknown-linux-gnu.tar.gz - - name: Unpack pose - if: ${{ github.ref != 'refs/heads/master' }} - run: tar -xvf pose*.tar.gz - name: Build compose file for CI with pose if: ${{ github.ref != 'refs/heads/master' }} - run: ./pose --no-docker config --tag "${GITHUB_REF_SLUG}" --tag-filter regex=mrsarm/ --progress -o ci.yaml + run: | + ./pose --no-docker config --tag "${GITHUB_REF_SLUG}" --tag-filter regex=mrsarm/ --progress -o ci.yaml - name: Create compose file for CI without pose if: ${{ github.ref == 'refs/heads/master' }} run: cp compose.yaml ci.yaml From 80768049edacbbf58257c648511b565e5aea2d93 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Thu, 25 Apr 2024 11:03:13 -0300 Subject: [PATCH 27/60] CI pull all images --- .github/workflows/e2e.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a26d6db..2d68526 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -57,7 +57,8 @@ jobs: if: ${{ github.ref == 'refs/heads/master' }} run: cp compose.yaml ci.yaml - name: Pull images - run: docker compose -f ci.yaml pull + run: docker compose -f ci.yaml pull \ + && docker compose -f ci.yaml pull dcoleman-e2e # images with profiles are not pulled by default - name: Run e2e tests run: docker compose -f ci.yaml run dcoleman-e2e From d5ea44dd1c18f4ecc4a4707f7ef8871bed5ce600 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Thu, 25 Apr 2024 11:06:20 -0300 Subject: [PATCH 28/60] Typo --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 2d68526..31fd33a 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -57,7 +57,7 @@ jobs: if: ${{ github.ref == 'refs/heads/master' }} run: cp compose.yaml ci.yaml - name: Pull images - run: docker compose -f ci.yaml pull \ + run: docker compose -f ci.yaml pull && docker compose -f ci.yaml pull dcoleman-e2e # images with profiles are not pulled by default - name: Run e2e tests run: docker compose -f ci.yaml run dcoleman-e2e From fe62f813d410ee3a4e3037393ad5876b5b16b822 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Thu, 25 Apr 2024 18:17:38 -0300 Subject: [PATCH 29/60] Use pose to define tag --- .github/workflows/e2e.yml | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 31fd33a..a480063 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -11,8 +11,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Inject slug/short variables - uses: rlespinasse/github-slug-action@v4 - name: Login to Docker Hub uses: docker/login-action@v3 @@ -20,51 +18,59 @@ jobs: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Download pose + run: wget https://github.com/mrsarm/pose/releases/download/0.4.0-b5/pose-0.4.0-b5-x86_64-unknown-linux-gnu.tar.gz + - name: Unpack pose + run: tar -xvf pose*.tar.gz + + - name: Define $TAG variable + run: ./pose slug $GITHUB_REF_NAME" >> $TAG + - name: Build the Docker image - run: ./docker-build.sh "${GITHUB_REF_SLUG}" + run: ./docker-build.sh $TAG + - name: Run tests - run: docker run --rm -e PROCESS_TYPE=test --name django-coleman "mrsarm/django-coleman:${GITHUB_REF_SLUG}" + run: docker run --rm -e PROCESS_TYPE=test --name django-coleman "mrsarm/django-coleman:$TAG" + - name: Release Docker image if: ${{ github.ref != 'refs/heads/master' }} - run: docker push "mrsarm/django-coleman:${GITHUB_REF_SLUG}" + run: docker push "mrsarm/django-coleman:$TAG" - - name: Download pose - run: wget https://github.com/mrsarm/pose/releases/download/0.4.0-b5/pose-0.4.0-b5-x86_64-unknown-linux-gnu.tar.gz - - name: Unpack pose - run: tar -xvf pose*.tar.gz - name: Get compose.yaml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | ./pose get -H "Authorization: token $GITHUB_TOKEN" \ - "https://raw.githubusercontent.com/mrsarm/dcoleman-e2e/$GITHUB_REF_SLUG/compose.yaml" \ - "$GITHUB_REF_SLUG:main" + "https://raw.githubusercontent.com/mrsarm/dcoleman-e2e/$TAG/compose.yaml" "$TAG:main" - name: Get .env.example env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | ./pose get -H "Authorization: token $GITHUB_TOKEN" \ - "https://raw.githubusercontent.com/mrsarm/dcoleman-e2e/$GITHUB_REF_SLUG/.env.example" \ - "$GITHUB_REF_SLUG:main" + "https://raw.githubusercontent.com/mrsarm/dcoleman-e2e/$TAG/.env.example" "$TAG:main" - name: Setup environment variables run: cp .env.example .env + - name: Build compose file for CI with pose if: ${{ github.ref != 'refs/heads/master' }} run: | - ./pose --no-docker config --tag "${GITHUB_REF_SLUG}" --tag-filter regex=mrsarm/ --progress -o ci.yaml + ./pose --no-docker config --tag $TAG --tag-filter regex=mrsarm/ --progress -o ci.yaml + - name: Create compose file for CI without pose if: ${{ github.ref == 'refs/heads/master' }} run: cp compose.yaml ci.yaml + - name: Pull images run: docker compose -f ci.yaml pull && docker compose -f ci.yaml pull dcoleman-e2e # images with profiles are not pulled by default + - name: Run e2e tests run: docker compose -f ci.yaml run dcoleman-e2e - name: Tag "latest" if: ${{ github.ref == 'refs/heads/master' }} - run: docker tag "mrsarm/django-coleman:${GITHUB_REF_SLUG}" mrsarm/django-coleman:latest + run: docker tag "mrsarm/django-coleman:$TAG" mrsarm/django-coleman:latest - name: Release "latest" if: ${{ github.ref == 'refs/heads/master' }} run: docker push mrsarm/django-coleman:latest From ed50beb3c86cfa2d4103450a6a55cc9eec3a40f4 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Thu, 25 Apr 2024 18:19:26 -0300 Subject: [PATCH 30/60] Typo --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a480063..392f44f 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -24,7 +24,7 @@ jobs: run: tar -xvf pose*.tar.gz - name: Define $TAG variable - run: ./pose slug $GITHUB_REF_NAME" >> $TAG + run: ./pose slug $GITHUB_REF_NAME >> $TAG - name: Build the Docker image run: ./docker-build.sh $TAG From edd349cb2d932ac330ed7f2fd8565a79ef6bf663 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Thu, 25 Apr 2024 18:22:34 -0300 Subject: [PATCH 31/60] Fix script definition --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 392f44f..fd89c31 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -24,7 +24,7 @@ jobs: run: tar -xvf pose*.tar.gz - name: Define $TAG variable - run: ./pose slug $GITHUB_REF_NAME >> $TAG + run: echo "TAG=$(./pose slug $GITHUB_REF_NAME)" >> "$GITHUB_ENV" - name: Build the Docker image run: ./docker-build.sh $TAG From 4eaf389d04d86ee26703e6a80710a0a6b93e96cf Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Thu, 25 Apr 2024 18:25:53 -0300 Subject: [PATCH 32/60] Echo tag --- .github/workflows/e2e.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index fd89c31..107980e 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -25,6 +25,7 @@ jobs: - name: Define $TAG variable run: echo "TAG=$(./pose slug $GITHUB_REF_NAME)" >> "$GITHUB_ENV" + - run: echo "Tag is --> $TAG" - name: Build the Docker image run: ./docker-build.sh $TAG From 8606a9e9566babd44493694e4e9ba31f6c88f805 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Thu, 25 Apr 2024 18:32:05 -0300 Subject: [PATCH 33/60] Fix print tag --- .github/workflows/e2e.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 107980e..9f33709 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -25,7 +25,8 @@ jobs: - name: Define $TAG variable run: echo "TAG=$(./pose slug $GITHUB_REF_NAME)" >> "$GITHUB_ENV" - - run: echo "Tag is --> $TAG" + - name: Print tag and image names + run: echo -e "- TAG --> $TAG\n- IMAGE --> mrsarm/django-coleman:$TAG" - name: Build the Docker image run: ./docker-build.sh $TAG From ff02537794a2959618f09fc6cf4c4571499e9219 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Fri, 26 Apr 2024 10:18:02 -0300 Subject: [PATCH 34/60] Does run works without \ breaks? --- .github/workflows/e2e.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 9f33709..a71da4b 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -42,14 +42,14 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - ./pose get -H "Authorization: token $GITHUB_TOKEN" \ - "https://raw.githubusercontent.com/mrsarm/dcoleman-e2e/$TAG/compose.yaml" "$TAG:main" + ./pose get -H "Authorization: token $GITHUB_TOKEN" + "https://raw.githubusercontent.com/mrsarm/dcoleman-e2e/$TAG/compose.yaml" "$TAG:main" - name: Get .env.example env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - ./pose get -H "Authorization: token $GITHUB_TOKEN" \ - "https://raw.githubusercontent.com/mrsarm/dcoleman-e2e/$TAG/.env.example" "$TAG:main" + ./pose get -H "Authorization: token $GITHUB_TOKEN" + "https://raw.githubusercontent.com/mrsarm/dcoleman-e2e/$TAG/.env.example" "$TAG:main" - name: Setup environment variables run: cp .env.example .env @@ -65,7 +65,7 @@ jobs: - name: Pull images run: docker compose -f ci.yaml pull - && docker compose -f ci.yaml pull dcoleman-e2e # images with profiles are not pulled by default + && docker compose -f ci.yaml pull dcoleman-e2e # services with profiles are not pulled by default - name: Run e2e tests run: docker compose -f ci.yaml run dcoleman-e2e From 9f6240d18f30646edc816fe18a878ae4d0e85f1c Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Fri, 26 Apr 2024 10:23:02 -0300 Subject: [PATCH 35/60] Rollback escaping --- .github/workflows/e2e.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a71da4b..ace21e5 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -42,14 +42,14 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - ./pose get -H "Authorization: token $GITHUB_TOKEN" - "https://raw.githubusercontent.com/mrsarm/dcoleman-e2e/$TAG/compose.yaml" "$TAG:main" + ./pose get -H "Authorization: token $GITHUB_TOKEN" \ + "https://raw.githubusercontent.com/mrsarm/dcoleman-e2e/$TAG/compose.yaml" "$TAG:main" - name: Get .env.example env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - ./pose get -H "Authorization: token $GITHUB_TOKEN" - "https://raw.githubusercontent.com/mrsarm/dcoleman-e2e/$TAG/.env.example" "$TAG:main" + ./pose get -H "Authorization: token $GITHUB_TOKEN" \ + "https://raw.githubusercontent.com/mrsarm/dcoleman-e2e/$TAG/.env.example" "$TAG:main" - name: Setup environment variables run: cp .env.example .env From 486b6b26bc52b877562e2a5d10564316a3bdc3e7 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Sat, 27 Apr 2024 21:55:33 -0300 Subject: [PATCH 36/60] Simply pose install --- .github/workflows/e2e.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index ace21e5..e62f08d 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -18,10 +18,10 @@ jobs: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Download pose - run: wget https://github.com/mrsarm/pose/releases/download/0.4.0-b5/pose-0.4.0-b5-x86_64-unknown-linux-gnu.tar.gz - - name: Unpack pose - run: tar -xvf pose*.tar.gz + - name: Install pose + run: | + wget https://github.com/mrsarm/pose/releases/download/0.4.0-b5/pose-0.4.0-b5-x86_64-unknown-linux-gnu.tar.gz -O - \ + | tar -xvzf - name: Define $TAG variable run: echo "TAG=$(./pose slug $GITHUB_REF_NAME)" >> "$GITHUB_ENV" From 1608918fb210b5c1901552a07c92a3ba5661aaf1 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Sat, 27 Apr 2024 22:00:55 -0300 Subject: [PATCH 37/60] Fix pipe to tar --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index e62f08d..be79e3c 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -21,7 +21,7 @@ jobs: - name: Install pose run: | wget https://github.com/mrsarm/pose/releases/download/0.4.0-b5/pose-0.4.0-b5-x86_64-unknown-linux-gnu.tar.gz -O - \ - | tar -xvzf + | tar -xz - name: Define $TAG variable run: echo "TAG=$(./pose slug $GITHUB_REF_NAME)" >> "$GITHUB_ENV" From 073ca0da8e49aaf6327d9987aae86a214575166e Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Mon, 29 Apr 2024 09:09:34 -0300 Subject: [PATCH 38/60] Doc updates --- README.rst | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index 5d104b5..3ce946f 100644 --- a/README.rst +++ b/README.rst @@ -28,6 +28,11 @@ Features * Pytest with some tests as example and code coverage reports configured. * Docker and Docker Compose configurations (images published in `Docker Hub `_). +* CI environment, and E2E tests written with Playwright: + `dcoleman-e2e `_. CI is executed with + GitHub Actions, and executed on each push in this project, + the viewer repo, or the E2E repo itself. The task also releases the image + in the Docker Registry. * Ready to use "production" configurations as reference. .. image:: docs/source/_static/img/django-coleman.png @@ -117,21 +122,23 @@ Docker A reference ``_ is provided, and the image published in `Docker Hub `_. -Also ``_ and `<.env.example>`_ files are provided, you can run -all from here, Django Coleman, the viewer app and Postgres. +Also ``compose.yaml`` and ``.env.example`` files are provided in the +`dcoleman-e2e `_ project, you +can run all from there, Django Coleman, the viewer app and Postgres, +and the E2E tests. -First, copy the ``.env.example`` file as ``.env`` file, and edit whatever -value you want to:: +First, copy the ``.env.example`` file as ``.env`` files from the E2E repo, +and edit whatever value you want to:: - $ cp .env.example .env + $ cp ../dcoleman-e2e/.env.example .env Then before run for the first time the containers, you have to either download the images from Docker Hub or build them from the source code. To build the images from the source code, execute:: - $ docker compose build + $ ./docker-build.sh -Or to get the images from Docker Hub, execute:: +Or to get the images from Docker Hub, execute from the dcoleman-e2e repo:: $ docker compose pull @@ -300,6 +307,6 @@ About **Project**: https://github.com/mrsarm/django-coleman -**Authors**: (2017-2023) Mariano Ruiz +**Authors**: (2017-2024) Mariano Ruiz **License**: AGPL-v3 From 7e931995876ff266c6ce43b5f9aeb71755028540 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Tue, 30 Apr 2024 18:56:06 -0300 Subject: [PATCH 39/60] UUpdate pose version --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index be79e3c..1ca5f80 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -20,7 +20,7 @@ jobs: - name: Install pose run: | - wget https://github.com/mrsarm/pose/releases/download/0.4.0-b5/pose-0.4.0-b5-x86_64-unknown-linux-gnu.tar.gz -O - \ + wget https://github.com/mrsarm/pose/releases/download/0.4.0/pose-0.4.0-x86_64-unknown-linux-gnu.tar.gz -O - \ | tar -xz - name: Define $TAG variable From 24356d73e72a154daebf9ba112361abc2044ac90 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Tue, 30 Apr 2024 19:27:24 -0300 Subject: [PATCH 40/60] Fix CI config --- .github/workflows/e2e.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 1ca5f80..d92ecd9 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Login to Docker Hub uses: docker/login-action@v3 @@ -35,7 +35,6 @@ jobs: run: docker run --rm -e PROCESS_TYPE=test --name django-coleman "mrsarm/django-coleman:$TAG" - name: Release Docker image - if: ${{ github.ref != 'refs/heads/master' }} run: docker push "mrsarm/django-coleman:$TAG" - name: Get compose.yaml @@ -54,15 +53,11 @@ jobs: - name: Setup environment variables run: cp .env.example .env - - name: Build compose file for CI with pose + - name: Build compose file for CI if: ${{ github.ref != 'refs/heads/master' }} run: | ./pose --no-docker config --tag $TAG --tag-filter regex=mrsarm/ --progress -o ci.yaml - - name: Create compose file for CI without pose - if: ${{ github.ref == 'refs/heads/master' }} - run: cp compose.yaml ci.yaml - - name: Pull images run: docker compose -f ci.yaml pull && docker compose -f ci.yaml pull dcoleman-e2e # services with profiles are not pulled by default From f0f6ed30437adbd1ebc4cf81e3bf3d028db4822e Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Tue, 30 Apr 2024 19:33:13 -0300 Subject: [PATCH 41/60] Fix CI step --- .github/workflows/e2e.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index d92ecd9..06c4432 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -54,7 +54,6 @@ jobs: run: cp .env.example .env - name: Build compose file for CI - if: ${{ github.ref != 'refs/heads/master' }} run: | ./pose --no-docker config --tag $TAG --tag-filter regex=mrsarm/ --progress -o ci.yaml From 3265ebf771b4b54a5ff6799896ed0676787fb7c5 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Fri, 10 May 2024 11:26:51 -0300 Subject: [PATCH 42/60] Split echo command --- .github/workflows/e2e.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 06c4432..e60375e 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -26,7 +26,9 @@ jobs: - name: Define $TAG variable run: echo "TAG=$(./pose slug $GITHUB_REF_NAME)" >> "$GITHUB_ENV" - name: Print tag and image names - run: echo -e "- TAG --> $TAG\n- IMAGE --> mrsarm/django-coleman:$TAG" + run: | + echo "- TAG --> $TAG" + echo "- IMAGE --> mrsarm/django-coleman:$TAG" - name: Build the Docker image run: ./docker-build.sh $TAG From a92d54172c07a8ec01f8a70eeccb97eebda52d80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 19:07:54 +0000 Subject: [PATCH 43/60] Bump djangorestframework from 3.14.0 to 3.15.2 in /requirements Bumps [djangorestframework](https://github.com/encode/django-rest-framework) from 3.14.0 to 3.15.2. - [Release notes](https://github.com/encode/django-rest-framework/releases) - [Commits](https://github.com/encode/django-rest-framework/compare/3.14.0...3.15.2) --- updated-dependencies: - dependency-name: djangorestframework dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements/requirements-dev.in | 2 +- requirements/requirements-dev.txt | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/requirements/requirements-dev.in b/requirements/requirements-dev.in index b3b04f7..206d5cc 100644 --- a/requirements/requirements-dev.in +++ b/requirements/requirements-dev.in @@ -3,6 +3,6 @@ environs~=9.5.0 dj-database-url~=1.3.0 django-admin-list-filter-dropdown~=1.0.3 django-adminfilters~=2.1.0 -djangorestframework~=3.14.0 +djangorestframework~=3.15.2 django-extensions~=3.2.1 django-health-check~=3.17.0 diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index d58bcad..9468333 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -23,7 +23,7 @@ django-extensions==3.2.1 # via -r requirements-dev.in django-health-check==3.17.0 # via -r requirements-dev.in -djangorestframework==3.14.0 +djangorestframework==3.15.2 # via -r requirements-dev.in environs==9.5.0 # via -r requirements-dev.in @@ -31,8 +31,6 @@ marshmallow==3.14.1 # via environs python-dotenv==0.19.2 # via environs -pytz==2022.1 - # via djangorestframework sqlparse==0.5.0 # via django typing-extensions==4.5.0 From 6c39c1516a726c23c117f1b493b5b93b075e87d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2024 19:18:22 +0000 Subject: [PATCH 44/60] Bump django from 4.2.11 to 4.2.15 in /requirements Bumps [django](https://github.com/django/django) from 4.2.11 to 4.2.15. - [Commits](https://github.com/django/django/compare/4.2.11...4.2.15) --- updated-dependencies: - dependency-name: django dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index d58bcad..4150ad3 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -8,7 +8,7 @@ asgiref==3.6.0 # via django dj-database-url==1.3.0 # via -r requirements-dev.in -django==4.2.11 +django==4.2.15 # via # -r requirements-dev.in # dj-database-url From 8bd003679ab0ebeedf39ba18873587608206b770 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Wed, 7 Aug 2024 17:37:30 -0300 Subject: [PATCH 45/60] CI conditional steps --- .github/workflows/e2e.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index e60375e..ddf41b9 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -14,6 +14,7 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 + if: ${{ secrets.DOCKERHUB_TOKEN }} with: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -37,6 +38,7 @@ jobs: run: docker run --rm -e PROCESS_TYPE=test --name django-coleman "mrsarm/django-coleman:$TAG" - name: Release Docker image + if: ${{ secrets.DOCKERHUB_TOKEN }} run: docker push "mrsarm/django-coleman:$TAG" - name: Get compose.yaml @@ -67,8 +69,8 @@ jobs: run: docker compose -f ci.yaml run dcoleman-e2e - name: Tag "latest" - if: ${{ github.ref == 'refs/heads/master' }} + if: ${{ secrets.DOCKERHUB_TOKEN && github.ref == 'refs/heads/master' }} run: docker tag "mrsarm/django-coleman:$TAG" mrsarm/django-coleman:latest - name: Release "latest" - if: ${{ github.ref == 'refs/heads/master' }} + if: ${{ secrets.DOCKERHUB_TOKEN && github.ref == 'refs/heads/master' }} run: docker push mrsarm/django-coleman:latest From 24c5eaa2d9e2ca5b7dae34b497d687297a9ac37a Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Wed, 7 Aug 2024 17:47:50 -0300 Subject: [PATCH 46/60] Fix CI conditional steps --- .github/workflows/e2e.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index ddf41b9..1c077f0 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -14,10 +14,12 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 - if: ${{ secrets.DOCKERHUB_TOKEN }} + if: ${{ vars.DOCKERHUB_TOKEN }} with: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + env: + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - name: Install pose run: | @@ -38,8 +40,10 @@ jobs: run: docker run --rm -e PROCESS_TYPE=test --name django-coleman "mrsarm/django-coleman:$TAG" - name: Release Docker image - if: ${{ secrets.DOCKERHUB_TOKEN }} + if: ${{ env.DOCKERHUB_TOKEN }} run: docker push "mrsarm/django-coleman:$TAG" + env: + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - name: Get compose.yaml env: @@ -69,8 +73,12 @@ jobs: run: docker compose -f ci.yaml run dcoleman-e2e - name: Tag "latest" - if: ${{ secrets.DOCKERHUB_TOKEN && github.ref == 'refs/heads/master' }} + if: ${{ env.DOCKERHUB_TOKEN && github.ref == 'refs/heads/master' }} run: docker tag "mrsarm/django-coleman:$TAG" mrsarm/django-coleman:latest + env: + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - name: Release "latest" - if: ${{ secrets.DOCKERHUB_TOKEN && github.ref == 'refs/heads/master' }} + if: ${{ env.DOCKERHUB_TOKEN && github.ref == 'refs/heads/master' }} run: docker push mrsarm/django-coleman:latest + env: + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} From b4d80c0650166479153f5febd239d9100f26a2ad Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Wed, 7 Aug 2024 17:54:38 -0300 Subject: [PATCH 47/60] Fix CI conditional steps --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 1c077f0..3e7439a 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -14,7 +14,7 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 - if: ${{ vars.DOCKERHUB_TOKEN }} + if: ${{ env.DOCKERHUB_TOKEN }} with: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} From 89f7d1113b527ffd37eba883c3e6ead5297ea834 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Thu, 29 Aug 2024 17:57:39 -0300 Subject: [PATCH 48/60] Update test libs --- requirements/requirements-test.in | 4 ++-- requirements/requirements-test.txt | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/requirements/requirements-test.in b/requirements/requirements-test.in index efbbea5..159a1a4 100644 --- a/requirements/requirements-test.in +++ b/requirements/requirements-test.in @@ -1,3 +1,3 @@ -pytest~=7.3.0 +pytest~=7.4.4 pytest-cov~=4.0.0 -pytest-django==4.5.2 +pytest-django==4.8.0 diff --git a/requirements/requirements-test.txt b/requirements/requirements-test.txt index c6e3f97..8716275 100644 --- a/requirements/requirements-test.txt +++ b/requirements/requirements-test.txt @@ -12,16 +12,16 @@ packaging==21.3 # via pytest pluggy==1.0.0 # via pytest -pyparsing==3.0.7 +pyparsing==3.1.4 # via packaging -pytest==7.3.0 +pytest==7.4.4 # via # -r requirements-test.in # pytest-cov # pytest-django pytest-cov==4.0.0 # via -r requirements-test.in -pytest-django==4.5.2 +pytest-django==4.8.0 # via -r requirements-test.in tomli==2.0.1 # via coverage From 8d1772a9100cd2205855c223df638443df104e25 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Thu, 29 Aug 2024 18:22:53 -0300 Subject: [PATCH 49/60] Add SSO with Google within the Admin --- README.rst | 3 ++- coleman/settings.py | 10 ++++++++ coleman/urls.py | 11 +++++--- requirements/requirements-dev.in | 1 + requirements/requirements-dev.txt | 42 +++++++++++++++++++++++++++++++ 5 files changed, 63 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 3ce946f..d4378e1 100644 --- a/README.rst +++ b/README.rst @@ -15,7 +15,8 @@ Features partner (customer, provider...), description, responsible of the task, priority... * Each task may have items: sub-tasks to be done. * The built-in Django *Authentication and Authorization* system - to manage users and groups, login, etc. + to manage users and groups, login, etc, and optionally SSO with Google + within the Admin (`django-google-sso `_). * Module `django-adminfilters `_ that allows multiselection searches. * Send emails when a task is created. diff --git a/coleman/settings.py b/coleman/settings.py index 0debcbf..e776cb1 100644 --- a/coleman/settings.py +++ b/coleman/settings.py @@ -49,6 +49,7 @@ 'django.contrib.staticfiles', 'django_extensions', 'health_check', + 'django_google_sso', ] REST_ENABLED = env.bool('REST_ENABLED', False) @@ -177,6 +178,15 @@ } +GOOGLE_SSO_ENABLED = env.bool('GOOGLE_SSO_ENABLED', False) +SSO_SHOW_FORM_ON_ADMIN_PAGE = env.bool('SSO_SHOW_FORM_ON_ADMIN_PAGE', True) +GOOGLE_SSO_CLIENT_ID = env.str("GOOGLE_SSO_CLIENT_ID", None) +GOOGLE_SSO_CLIENT_SECRET = env.str('GOOGLE_SSO_CLIENT_SECRET', None) +GOOGLE_SSO_PROJECT_ID = env.str('GOOGLE_SSO_PROJECT_ID', "django-coleman") +GOOGLE_SSO_AUTO_CREATE_USERS = True +GOOGLE_SSO_STAFF_LIST = ["*"] +GOOGLE_SSO_ALLOWABLE_DOMAINS = env.str('GOOGLE_SSO_ALLOWABLE_DOMAINS', "gmail.com").split(',') + # # Custom configurations # diff --git a/coleman/urls.py b/coleman/urls.py index 85ba623..3aac851 100644 --- a/coleman/urls.py +++ b/coleman/urls.py @@ -13,9 +13,8 @@ 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ -from django.urls import re_path, include +from django.urls import path, re_path, include from django.contrib import admin -from django.urls import path from django.conf import settings from django.http import HttpResponseRedirect @@ -29,13 +28,19 @@ urlpatterns = [ re_path('^api/v1/', include(router.urls)), + re_path(r'^health/', include('health_check.urls')), + path( + "google_sso/", include( + "django_google_sso.urls", + namespace="django_google_sso" + ) + ), ] if settings.ADMIN: urlpatterns = [ re_path(r'^$', lambda r: HttpResponseRedirect('admin/')), # Remove this redirect if you add custom views path('admin/', admin.site.urls), - re_path(r'^health/', include('health_check.urls')), ] + urlpatterns admin.site.site_title = admin.site.site_header = settings.SITE_HEADER diff --git a/requirements/requirements-dev.in b/requirements/requirements-dev.in index 206d5cc..21d9426 100644 --- a/requirements/requirements-dev.in +++ b/requirements/requirements-dev.in @@ -5,4 +5,5 @@ django-admin-list-filter-dropdown~=1.0.3 django-adminfilters~=2.1.0 djangorestframework~=3.15.2 django-extensions~=3.2.1 +django-google-sso~=6.5.0 django-health-check~=3.17.0 diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index a18fef6..458bfa8 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -6,6 +6,12 @@ # asgiref==3.6.0 # via django +cachetools==5.5.0 + # via google-auth +certifi==2024.7.4 + # via requests +charset-normalizer==3.3.2 + # via requests dj-database-url==1.3.0 # via -r requirements-dev.in django==4.2.15 @@ -13,6 +19,7 @@ django==4.2.15 # -r requirements-dev.in # dj-database-url # django-extensions + # django-google-sso # django-health-check # djangorestframework django-admin-list-filter-dropdown==1.0.3 @@ -21,17 +28,52 @@ django-adminfilters==2.1.0 # via -r requirements-dev.in django-extensions==3.2.1 # via -r requirements-dev.in +django-google-sso==6.5.0 + # via -r requirements-dev.in django-health-check==3.17.0 # via -r requirements-dev.in djangorestframework==3.15.2 # via -r requirements-dev.in environs==9.5.0 # via -r requirements-dev.in +google-auth==2.34.0 + # via + # django-google-sso + # google-auth-httplib2 + # google-auth-oauthlib +google-auth-httplib2==0.2.0 + # via django-google-sso +google-auth-oauthlib==1.2.1 + # via django-google-sso +httplib2==0.22.0 + # via google-auth-httplib2 +idna==3.8 + # via requests +loguru==0.7.2 + # via django-google-sso marshmallow==3.14.1 # via environs +oauthlib==3.2.2 + # via requests-oauthlib +pyasn1==0.6.0 + # via + # pyasn1-modules + # rsa +pyasn1-modules==0.4.0 + # via google-auth +pyparsing==3.1.4 + # via httplib2 python-dotenv==0.19.2 # via environs +requests==2.32.3 + # via requests-oauthlib +requests-oauthlib==2.0.0 + # via google-auth-oauthlib +rsa==4.9 + # via google-auth sqlparse==0.5.0 # via django typing-extensions==4.5.0 # via dj-database-url +urllib3==2.2.2 + # via requests From 1a11b8622dfda1a02f9c423b49f44ac53317bc96 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Mon, 2 Sep 2024 11:17:26 -0300 Subject: [PATCH 50/60] Google SSO enable/disable at runtime --- coleman/settings.py | 19 +++++++++++-------- coleman/urls.py | 16 ++++++++++------ 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/coleman/settings.py b/coleman/settings.py index e776cb1..bdf6c5b 100644 --- a/coleman/settings.py +++ b/coleman/settings.py @@ -49,7 +49,6 @@ 'django.contrib.staticfiles', 'django_extensions', 'health_check', - 'django_google_sso', ] REST_ENABLED = env.bool('REST_ENABLED', False) @@ -178,14 +177,18 @@ } +# Google SSO (django-google-sso) GOOGLE_SSO_ENABLED = env.bool('GOOGLE_SSO_ENABLED', False) -SSO_SHOW_FORM_ON_ADMIN_PAGE = env.bool('SSO_SHOW_FORM_ON_ADMIN_PAGE', True) -GOOGLE_SSO_CLIENT_ID = env.str("GOOGLE_SSO_CLIENT_ID", None) -GOOGLE_SSO_CLIENT_SECRET = env.str('GOOGLE_SSO_CLIENT_SECRET', None) -GOOGLE_SSO_PROJECT_ID = env.str('GOOGLE_SSO_PROJECT_ID', "django-coleman") -GOOGLE_SSO_AUTO_CREATE_USERS = True -GOOGLE_SSO_STAFF_LIST = ["*"] -GOOGLE_SSO_ALLOWABLE_DOMAINS = env.str('GOOGLE_SSO_ALLOWABLE_DOMAINS', "gmail.com").split(',') +if GOOGLE_SSO_ENABLED: + SSO_SHOW_FORM_ON_ADMIN_PAGE = env.bool('SSO_SHOW_FORM_ON_ADMIN_PAGE', True) + GOOGLE_SSO_CLIENT_ID = env.str("GOOGLE_SSO_CLIENT_ID", None) + GOOGLE_SSO_CLIENT_SECRET = env.str('GOOGLE_SSO_CLIENT_SECRET', None) + GOOGLE_SSO_PROJECT_ID = env.str('GOOGLE_SSO_PROJECT_ID', "django-coleman") + GOOGLE_SSO_AUTO_CREATE_USERS = True + GOOGLE_SSO_STAFF_LIST = ["*"] + GOOGLE_SSO_ALLOWABLE_DOMAINS = env.str('GOOGLE_SSO_ALLOWABLE_DOMAINS', "gmail.com").split(',') + INSTALLED_APPS += ['django_google_sso'] + # # Custom configurations diff --git a/coleman/urls.py b/coleman/urls.py index 3aac851..0ead31a 100644 --- a/coleman/urls.py +++ b/coleman/urls.py @@ -29,12 +29,6 @@ urlpatterns = [ re_path('^api/v1/', include(router.urls)), re_path(r'^health/', include('health_check.urls')), - path( - "google_sso/", include( - "django_google_sso.urls", - namespace="django_google_sso" - ) - ), ] if settings.ADMIN: @@ -43,5 +37,15 @@ path('admin/', admin.site.urls), ] + urlpatterns +if settings.GOOGLE_SSO_ENABLED: + urlpatterns = [ + path( + "google_sso/", include( + "django_google_sso.urls", + namespace="django_google_sso" + ) + ), + ] + urlpatterns + admin.site.site_title = admin.site.site_header = settings.SITE_HEADER admin.site.index_title = settings.INDEX_TITLE From 4cb565f63a4487c56d08403838d6f6d6bb82fac3 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Mon, 2 Sep 2024 11:25:27 -0300 Subject: [PATCH 51/60] Bump health package --- requirements/requirements-dev.in | 2 +- requirements/requirements-dev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/requirements-dev.in b/requirements/requirements-dev.in index 21d9426..7ec7207 100644 --- a/requirements/requirements-dev.in +++ b/requirements/requirements-dev.in @@ -6,4 +6,4 @@ django-adminfilters~=2.1.0 djangorestframework~=3.15.2 django-extensions~=3.2.1 django-google-sso~=6.5.0 -django-health-check~=3.17.0 +django-health-check~=3.18.3 diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index 458bfa8..7fc9ebb 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -30,7 +30,7 @@ django-extensions==3.2.1 # via -r requirements-dev.in django-google-sso==6.5.0 # via -r requirements-dev.in -django-health-check==3.17.0 +django-health-check==3.18.3 # via -r requirements-dev.in djangorestframework==3.15.2 # via -r requirements-dev.in From 4fb853774703943fa2ecf89f67137c5f06063071 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Mon, 2 Sep 2024 11:28:31 -0300 Subject: [PATCH 52/60] Bump django-extensions package --- requirements/requirements-dev.in | 2 +- requirements/requirements-dev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/requirements-dev.in b/requirements/requirements-dev.in index 7ec7207..c6f933c 100644 --- a/requirements/requirements-dev.in +++ b/requirements/requirements-dev.in @@ -4,6 +4,6 @@ dj-database-url~=1.3.0 django-admin-list-filter-dropdown~=1.0.3 django-adminfilters~=2.1.0 djangorestframework~=3.15.2 -django-extensions~=3.2.1 +django-extensions~=3.2.3 django-google-sso~=6.5.0 django-health-check~=3.18.3 diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index 7fc9ebb..2b7087f 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -26,7 +26,7 @@ django-admin-list-filter-dropdown==1.0.3 # via -r requirements-dev.in django-adminfilters==2.1.0 # via -r requirements-dev.in -django-extensions==3.2.1 +django-extensions==3.2.3 # via -r requirements-dev.in django-google-sso==6.5.0 # via -r requirements-dev.in From 796adba7eaf7b7bfde2d0762ad55d288eb297566 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Mon, 2 Sep 2024 11:32:55 -0300 Subject: [PATCH 53/60] Bump dj-database-url package --- requirements/requirements-dev.in | 2 +- requirements/requirements-dev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/requirements-dev.in b/requirements/requirements-dev.in index c6f933c..8faaa11 100644 --- a/requirements/requirements-dev.in +++ b/requirements/requirements-dev.in @@ -1,6 +1,6 @@ Django~=4.2 environs~=9.5.0 -dj-database-url~=1.3.0 +dj-database-url~=2.2.0 django-admin-list-filter-dropdown~=1.0.3 django-adminfilters~=2.1.0 djangorestframework~=3.15.2 diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index 2b7087f..4c6490d 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -12,7 +12,7 @@ certifi==2024.7.4 # via requests charset-normalizer==3.3.2 # via requests -dj-database-url==1.3.0 +dj-database-url==2.2.0 # via -r requirements-dev.in django==4.2.15 # via From 163001c10512fa7fc70969056ed3780126177675 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Mon, 2 Sep 2024 11:35:14 -0300 Subject: [PATCH 54/60] Bump prod packages --- requirements/requirements-prod.in | 4 ++-- requirements/requirements-prod.txt | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/requirements/requirements-prod.in b/requirements/requirements-prod.in index d1bf821..1e311fc 100644 --- a/requirements/requirements-prod.in +++ b/requirements/requirements-prod.in @@ -1,4 +1,4 @@ # Web server -uWSGI~=2.0.22 +uWSGI~=2.0.26 # PosgreSQL driver -psycopg[binary]~=3.1.8 +psycopg[binary]~=3.2.1 diff --git a/requirements/requirements-prod.txt b/requirements/requirements-prod.txt index 0174f24..504b2f8 100644 --- a/requirements/requirements-prod.txt +++ b/requirements/requirements-prod.txt @@ -4,11 +4,11 @@ # # pip-compile --no-emit-index-url --output-file=requirements-prod.txt requirements-prod.in # -psycopg[binary]==3.1.8 +psycopg[binary]==3.2.1 # via -r requirements-prod.in -psycopg-binary==3.1.8 +psycopg-binary==3.2.1 # via psycopg typing-extensions==4.5.0 # via psycopg -uwsgi==2.0.22 +uwsgi==2.0.26 # via -r requirements-prod.in From 833bf14ff0f590f495a36ab8dad3886daa460ef7 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Mon, 2 Sep 2024 11:57:11 -0300 Subject: [PATCH 55/60] Bump environs package --- requirements/requirements-dev.in | 2 +- requirements/requirements-dev.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements/requirements-dev.in b/requirements/requirements-dev.in index 8faaa11..cba3296 100644 --- a/requirements/requirements-dev.in +++ b/requirements/requirements-dev.in @@ -1,5 +1,5 @@ Django~=4.2 -environs~=9.5.0 +environs~=11.0.0 dj-database-url~=2.2.0 django-admin-list-filter-dropdown~=1.0.3 django-adminfilters~=2.1.0 diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index 4c6490d..d311aff 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -34,7 +34,7 @@ django-health-check==3.18.3 # via -r requirements-dev.in djangorestframework==3.15.2 # via -r requirements-dev.in -environs==9.5.0 +environs==11.0.0 # via -r requirements-dev.in google-auth==2.34.0 # via @@ -51,7 +51,7 @@ idna==3.8 # via requests loguru==0.7.2 # via django-google-sso -marshmallow==3.14.1 +marshmallow==3.22.0 # via environs oauthlib==3.2.2 # via requests-oauthlib From 4c214e2cbe9a78fa79eb2023636a375145dcd7f6 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Mon, 2 Sep 2024 11:58:50 -0300 Subject: [PATCH 56/60] Bump django-adminfilters package --- requirements/requirements-dev.in | 2 +- requirements/requirements-dev.txt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/requirements/requirements-dev.in b/requirements/requirements-dev.in index cba3296..1519c2a 100644 --- a/requirements/requirements-dev.in +++ b/requirements/requirements-dev.in @@ -2,7 +2,7 @@ Django~=4.2 environs~=11.0.0 dj-database-url~=2.2.0 django-admin-list-filter-dropdown~=1.0.3 -django-adminfilters~=2.1.0 +django-adminfilters~=2.4.3 djangorestframework~=3.15.2 django-extensions~=3.2.3 django-google-sso~=6.5.0 diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index d311aff..7e750fb 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -24,7 +24,7 @@ django==4.2.15 # djangorestframework django-admin-list-filter-dropdown==1.0.3 # via -r requirements-dev.in -django-adminfilters==2.1.0 +django-adminfilters==2.4.3 # via -r requirements-dev.in django-extensions==3.2.3 # via -r requirements-dev.in @@ -55,6 +55,8 @@ marshmallow==3.22.0 # via environs oauthlib==3.2.2 # via requests-oauthlib +packaging==24.1 + # via marshmallow pyasn1==0.6.0 # via # pyasn1-modules From 4bd2385715de492d3302086aec0476b85fe9c4a3 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Mon, 2 Sep 2024 12:03:03 -0300 Subject: [PATCH 57/60] Fix package version --- requirements/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements-test.txt b/requirements/requirements-test.txt index 8716275..dcd57d5 100644 --- a/requirements/requirements-test.txt +++ b/requirements/requirements-test.txt @@ -8,7 +8,7 @@ coverage[toml]==6.3.1 # via pytest-cov iniconfig==1.1.1 # via pytest -packaging==21.3 +packaging==24.1 # via pytest pluggy==1.0.0 # via pytest From 6176adb1968900367e538cd9fe381c817f5e8e65 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Mon, 2 Sep 2024 12:26:37 -0300 Subject: [PATCH 58/60] Expire session cookie after 8 hours --- coleman/settings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coleman/settings.py b/coleman/settings.py index bdf6c5b..ff4d2f9 100644 --- a/coleman/settings.py +++ b/coleman/settings.py @@ -176,6 +176,8 @@ ] } +SESSION_COOKIE_AGE = 8 * 60 * 60 + # Google SSO (django-google-sso) GOOGLE_SSO_ENABLED = env.bool('GOOGLE_SSO_ENABLED', False) From 1786ca142a04be04c9186cf5619e4734c492928e Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Mon, 2 Sep 2024 16:07:36 -0300 Subject: [PATCH 59/60] README fixes --- README.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index d4378e1..6a0ae01 100644 --- a/README.rst +++ b/README.rst @@ -45,7 +45,7 @@ Requirements Docker, or: -* Python 3.8+ (tested with Python 3.8 and 3.11). +* Python 3.10+ (tested with 3.11). * Django 4.2 LTS and other dependencies declared in the ``requirements.txt`` file (use virtual environments or containers!). * A Django compatible database like PostgreSQL (by default uses @@ -125,8 +125,9 @@ in `Docker Hub `_. Also ``compose.yaml`` and ``.env.example`` files are provided in the `dcoleman-e2e `_ project, you -can run all from there, Django Coleman, the viewer app and Postgres, -and the E2E tests. +can run all from there, Django Coleman, the +`viewer `_ app +and Postgres, and the E2E tests. First, copy the ``.env.example`` file as ``.env`` files from the E2E repo, and edit whatever value you want to:: @@ -200,10 +201,11 @@ set *debug* options to false:: $ DEBUG=False LANGUAGE_CODE=es-ar python3 manage.py runserver Also in development environments an ``.env`` file can be used to setup -the environment variables easily, checkout the `<.env.example>`_ as example. +the environment variables easily, checkout the +`.env.example `_ as example. You can copy the example file and edit the variables you want to change:: - $ cp .env.example .env + $ cp ../dcoleman-e2e/.env.example .env $ vi .env Some available settings: From 45a2d01eaaa718e7b6aa173e0d7b7c87284ab4ca Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Tue, 3 Sep 2024 11:48:23 -0300 Subject: [PATCH 60/60] Fix migration deps --- mtasks/migrations/0003_auth_groups.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mtasks/migrations/0003_auth_groups.py b/mtasks/migrations/0003_auth_groups.py index 3a50644..6f2a323 100644 --- a/mtasks/migrations/0003_auth_groups.py +++ b/mtasks/migrations/0003_auth_groups.py @@ -64,6 +64,8 @@ class Migration(migrations.Migration): """ dependencies = [ + ('contenttypes', '__latest__'), + ('auth', '__latest__'), ('mtasks', '0002_alter_task_options'), ]