Compare commits

..

2 commits

Author SHA1 Message Date
selfhoster1312
7c2a426404 ci: Test sql migrations with sqlite backend 2025-03-03 21:29:28 +01:00
selfhoster1312
41118fda23 feature: Enable sqlite3 support and make it default 2025-03-03 15:00:57 +01:00
3 changed files with 28 additions and 1 deletions

View file

@ -6,6 +6,7 @@ tests:
image: python:3.11
variables:
DJANGO_SETTINGS_MODULE: "la_chariotte.settings"
DB_ENGINE: "django.db.backends.postgresql"
DB_NAME: "postgres"
DB_USER: "postgres"
DB_PASSWORD: "mysecretpassword"
@ -30,3 +31,21 @@ tests:
- git fetch origin develop ; diff-cover coverage.xml --fail-under=90 --compare-branch origin/develop --diff-range-notation '..'
- echo "Tests done."
sqlite:
stage: test
image: python:3.11
variables:
DJANGO_SETTINGS_MODULE: "la_chariotte.settings"
script:
- export CACHE_PATH="/venvs/${CI_PROJECT_NAME}/$(date +week-%V-%Y)"
- if [[ "$CI_COMMIT_BRANCH" == *"--no-cache"* ]] ; then export CACHE_PATH="/venvs/$CI_COMMIT_SHORT_SHA"; fi
- echo "Creating virtual env..."
- if [ ! -d $CACHE_PATH/venv ] ; then python3.11 -m venv $CACHE_PATH/venv ; fi
- $CACHE_PATH/venv/bin/pip install --upgrade pip
- echo "Virtual env created."
- echo "Checking database migrations with sqlite..."
- source $CACHE_PATH/venv/bin/activate
- pip cache purge
- pip install -e ".[dev]"
- python3 manage.py migrate
- echo "sqlite database migrations successful"

View file

@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
since 0.4.1, and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## UNRELEASED (XXXX-YY-ZZ)
### Added
- SQLite is now a supported database engine for easier deployment;
use `"ENGINE": "django.db.backends.sqlite3"` in the settings to enable it;
the `"NAME"` setting is a relative path for the DB file, from the working directory
## 1.3.0 (2024-11-02)
This is a small release, with a few features and bugfixes. The code is now

View file

@ -85,7 +85,7 @@ WSGI_APPLICATION = "la_chariotte.wsgi.application"
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"ENGINE": os.getenv("DB_ENGINE", "django.db.backends.sqlite3"),
"NAME": os.getenv("DB_NAME", "chariotte.sqlite3"),
}
}