62 lines
1.5 KiB
Markdown
62 lines
1.5 KiB
Markdown
# Contributing
|
|
|
|
## TL;DR
|
|
|
|
### 1 Install system packages
|
|
|
|
```bash
|
|
sudo pacman -Syu --needed \
|
|
base-devel \
|
|
git \
|
|
python \
|
|
uv \
|
|
sqlite \
|
|
curl \
|
|
wget \
|
|
openssh \
|
|
squashfs-tools \
|
|
e2fsprogs \
|
|
caddy \
|
|
podman
|
|
```
|
|
|
|
Notes:
|
|
- `uv` is package/dependency runner used by repo.
|
|
- `squashfs-tools`, `openssh`, and `e2fsprogs` are needed for `get_rootfs.bash` image prep flow.
|
|
|
|
### 2 Bootstrap project
|
|
|
|
```bash
|
|
uv sync
|
|
```
|
|
|
|
### 3 Day-to-day commands
|
|
|
|
```bash
|
|
uv run python manage.py check
|
|
uv run pytest -n 5 -q
|
|
uv run ruff check . --fix
|
|
uv run ruff format .
|
|
# Start Celery workers
|
|
uv run celery -A config worker -l info
|
|
```
|
|
|
|
### 4 Local test deployment flow
|
|
|
|
Set `DJANGO_SECRET_KEY` before running Django management commands.
|
|
|
|
```bash
|
|
export DJANGO_SECRET_KEY="dev-only-secret"
|
|
uv run python manage.py create_test_deployment
|
|
```
|
|
|
|
The command creates a randomized tenant and hosted site, provisions PostgreSQL and Redis test containers,
|
|
builds a reusable local Django test image, and prints a localhost sentinel URL when the deployment reaches
|
|
`running`.
|
|
|
|
Open `/` or `/deployments/` in the Django web UI to inspect recent deployments, runtime service states,
|
|
live sentinel health, and the latest captured Podman log snapshots for Django, PostgreSQL, and Redis.
|
|
|
|
Use `--no-wait` only when you have a real cross-process Celery broker configured through
|
|
`TUSSILAGO_CELERY_BROKER_URL` and a worker process running. `memory://` is not valid for this mode because a
|
|
separate worker cannot consume in-memory tasks from another process.
|