From 888bd6507078741419d95623d0a78dde17400734 Mon Sep 17 00:00:00 2001 From: Kalle Westerling Date: Mon, 8 Jul 2024 09:14:58 +0100 Subject: [PATCH 1/4] Correct the environment names for database connection Fixes #178 --- docs/source/getting-started/setup/local/macos.rst | 10 +++++----- seshat/settings/local.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/source/getting-started/setup/local/macos.rst b/docs/source/getting-started/setup/local/macos.rst index 76ad05577..cdf1f55b2 100644 --- a/docs/source/getting-started/setup/local/macos.rst +++ b/docs/source/getting-started/setup/local/macos.rst @@ -219,11 +219,11 @@ The file should look like this: .. code-block:: - NAME= - USER=postgres - HOST=localhost - PORT=5432 - PASSWORD= + DB_NAME= + DB_USER=postgres + DB_HOST=localhost + DB_PORT=5432 + DB_PASSWORD= Step 10: Migrate the database diff --git a/seshat/settings/local.py b/seshat/settings/local.py index cc8cff03c..2dbdcf9c9 100644 --- a/seshat/settings/local.py +++ b/seshat/settings/local.py @@ -39,11 +39,11 @@ DATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.postgis', - 'NAME': env('NAME'), - 'USER': 'postgres', - 'HOST': env('HOST'), - 'PORT': env('PORT'), - 'PASSWORD': env('PASSWORD') + 'NAME': env('DB_NAME'), + 'USER': env('DB_USER') or 'postgres', + 'HOST': env('DB_HOST'), + 'PORT': env('DB_PORT'), + 'PASSWORD': env('DB_PASSWORD') } } """ From bf8f8074e6ac72f726faaab9d005b1ec1c85b194 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 8 Jul 2024 10:27:52 +0100 Subject: [PATCH 2/4] update repo --- .github/workflows/build.yml | 2 +- .github/workflows/tests.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b142a6f55..0893ae54a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,4 +30,4 @@ jobs: with: context: . push: true - tags: docker.pkg.github.com/edwardchalstrey1/seshat/tests-image:latest \ No newline at end of file + tags: docker.pkg.github.com/Seshat-Global-History-Databank/seshat/tests-image:latest \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 13b2c5912..02b0c19df 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,8 +20,8 @@ jobs: password: ${{ secrets.GH_TOKEN }} - name: Pull and run Docker image run: | - docker pull docker.pkg.github.com/edwardchalstrey1/seshat/tests-image:latest - docker run -d -p 5432:5432 -v ${{ github.workspace }}:/seshat -e DJANGO_SETTINGS_MODULE=seshat.settings.local -e POSTGRES_PASSWORD=postgres -e PGDATA=/var/lib/postgresql/data/db-files/ -e GITHUB_ACTIONS='true' --name seshat_testing docker.pkg.github.com/edwardchalstrey1/seshat/tests-image:latest + docker pull docker.pkg.github.com/Seshat-Global-History-Databank/seshat/tests-image:latest + docker run -d -p 5432:5432 -v ${{ github.workspace }}:/seshat -e DJANGO_SETTINGS_MODULE=seshat.settings.local -e POSTGRES_PASSWORD=postgres -e PGDATA=/var/lib/postgresql/data/db-files/ -e GITHUB_ACTIONS='true' --name seshat_testing docker.pkg.github.com/Seshat-Global-History-Databank/seshat/tests-image:latest - name: Sleep, then check PostgreSQL connectivity run: | sleep 10 From 10e737d719cd92d6c40bc2fd5cd4b19038f87670 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 8 Jul 2024 10:53:40 +0100 Subject: [PATCH 3/4] rebuild if the build yml is changed --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0893ae54a..a204663d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,11 +7,13 @@ on: paths: - 'Dockerfile' - 'requirements.txt' + - '.github/workflows/build.yml' pull_request: branches: [dev] paths: - 'Dockerfile' - 'requirements.txt' + - '.github/workflows/build.yml' jobs: build: From 2d582cf4054a4b2c09d24d3afc827cbda62ca849 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 8 Jul 2024 10:55:07 +0100 Subject: [PATCH 4/4] org name to lower case --- .github/workflows/build.yml | 2 +- .github/workflows/tests.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a204663d2..b9a859f64 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,4 +32,4 @@ jobs: with: context: . push: true - tags: docker.pkg.github.com/Seshat-Global-History-Databank/seshat/tests-image:latest \ No newline at end of file + tags: docker.pkg.github.com/seshat-global-history-databank/seshat/tests-image:latest \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 02b0c19df..b74fabf63 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,8 +20,8 @@ jobs: password: ${{ secrets.GH_TOKEN }} - name: Pull and run Docker image run: | - docker pull docker.pkg.github.com/Seshat-Global-History-Databank/seshat/tests-image:latest - docker run -d -p 5432:5432 -v ${{ github.workspace }}:/seshat -e DJANGO_SETTINGS_MODULE=seshat.settings.local -e POSTGRES_PASSWORD=postgres -e PGDATA=/var/lib/postgresql/data/db-files/ -e GITHUB_ACTIONS='true' --name seshat_testing docker.pkg.github.com/Seshat-Global-History-Databank/seshat/tests-image:latest + docker pull docker.pkg.github.com/seshat-global-history-databank/seshat/tests-image:latest + docker run -d -p 5432:5432 -v ${{ github.workspace }}:/seshat -e DJANGO_SETTINGS_MODULE=seshat.settings.local -e POSTGRES_PASSWORD=postgres -e PGDATA=/var/lib/postgresql/data/db-files/ -e GITHUB_ACTIONS='true' --name seshat_testing docker.pkg.github.com/seshat-global-history-databank/seshat/tests-image:latest - name: Sleep, then check PostgreSQL connectivity run: | sleep 10