Four workflows, none of which existed: * `tests.yml` — backend, desktop, `:core` and the web app's typecheck+build, in parallel. `:core` needs no Android SDK at all, because settings.gradle.kts leaves `:app` out when there is none; `:app`'s Robolectric suite therefore lives in the APK workflow, where the SDK is installed anyway. Nothing needs a running backend — the suites feed on committed fixtures, which is the whole reason they were written that way. * `lint.yml` — ruff, which the repo had been configured for and never run. * `docker.yml` — builds the image, *starts* it against SQLite and waits for /api/health before pushing, then publishes `:latest` and `:<short-sha>` to git.timka.su. A tag nobody can run is worse than no tag. * `android-release.yml` — the release APK on every push to master, signed from secrets, with `apksigner verify --print-certs` reporting which key was really used and failing if it was the debug one. Three things the repo needed before any of that could work: `versionCode` was pinned at 1, so every APK looked like the same version to the phone and would not install over its predecessor. It now comes from the run number, with `versionName` from a property, both via one `setting()` helper that reads a Gradle property or an environment variable. The release build fell back to the *debug* signing key whenever the keystore was missing — silently. That is a trap: the APK installs, looks fine, and can never be upgraded by a properly signed build. `KADENCE_REQUIRE_SIGNING=1` makes that case fail the build instead, and the release job sets it whenever a keystore secret is present. The compose files built an image with no name, so there was nothing to pull. `image:` now names the registry tag while `up --build` still builds locally. Also: `android/ci/install-sdk.sh` (idempotent, cacheable, and the one place that knows `platforms;android-37.0` is spelled with the minor version), the runner as a compose service with its config and a setup checklist, six make targets, and a README section. No runner is registered yet — `make ci-runner` is step two of that checklist. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
78 lines
2.9 KiB
YAML
78 lines
2.9 KiB
YAML
# Kadence: API + web UI in one container, Postgres beside it.
|
|
#
|
|
# cp .env.example .env # fill in Jira / Todoist / Telegram
|
|
# docker compose up -d # http://localhost:8000
|
|
#
|
|
# The native desktop app runs on your machine and points at this backend.
|
|
|
|
services:
|
|
db:
|
|
image: postgres:17-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-kadence}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-kadence}
|
|
POSTGRES_DB: ${POSTGRES_DB:-kadence}
|
|
volumes:
|
|
- db-data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
# The app's first query happens seconds after boot, so the API must not
|
|
# start until Postgres can actually answer.
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-kadence} -d ${POSTGRES_DB:-kadence}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
app:
|
|
# Named as well as built, so the same compose file can run a published image
|
|
# instead: `KADENCE_IMAGE=git.timka.su/timka123/kadence:latest docker compose pull`.
|
|
# `up --build` still builds locally and tags it with this name.
|
|
image: ${KADENCE_IMAGE:-git.timka.su/timka123/kadence:latest}
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
restart: unless-stopped
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
DATABASE_URL: >-
|
|
postgresql+psycopg://${POSTGRES_USER:-kadence}:${POSTGRES_PASSWORD:-kadence}@db:5432/${POSTGRES_DB:-kadence}
|
|
TZ: ${TIMEZONE:-Europe/Moscow}
|
|
TIMEZONE: ${TIMEZONE:-Europe/Moscow}
|
|
CORS_ORIGINS: ${CORS_ORIGINS:-*}
|
|
API_TOKEN: ${API_TOKEN:-}
|
|
SCHEDULER_ENABLED: ${SCHEDULER_ENABLED:-true}
|
|
TELEGRAM_BOT_ENABLED: ${TELEGRAM_BOT_ENABLED:-true}
|
|
LOG_LEVEL: ${LOG_LEVEL:-INFO}
|
|
|
|
# Web login — see .env.example for what each does.
|
|
AUTH_USERNAME: ${AUTH_USERNAME:-timka}
|
|
AUTH_PASSWORD: ${AUTH_PASSWORD:-}
|
|
TELEGRAM_OWNER_ID: ${TELEGRAM_OWNER_ID:-}
|
|
TELEGRAM_BOT_USERNAME: ${TELEGRAM_BOT_USERNAME:-}
|
|
|
|
# Seeds for the editable settings — the same variable names jira-helper
|
|
# uses, so an existing .env can be copied across unchanged.
|
|
JIRA_BASE_URL: ${JIRA_BASE_URL:-}
|
|
JIRA_EMAIL: ${JIRA_EMAIL:-}
|
|
JIRA_API_TOKEN: ${JIRA_API_TOKEN:-}
|
|
JIRA_EXTRA_JQL: ${JIRA_EXTRA_JQL:-}
|
|
JIRA_START_DATE_FIELD: ${JIRA_START_DATE_FIELD:-customfield_10015}
|
|
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
|
|
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:-}
|
|
GOOGLE_REFRESH_TOKEN: ${GOOGLE_REFRESH_TOKEN:-}
|
|
GOOGLE_TASKS_LISTS: ${GOOGLE_TASKS_LISTS:-}
|
|
TODOIST_API_TOKEN: ${TODOIST_API_TOKEN:-}
|
|
TODOIST_PROJECTS: ${TODOIST_PROJECTS:-}
|
|
LAUNDRY_SESSION: ${LAUNDRY_SESSION:-}
|
|
LAUNDRY_BASE_URL: ${LAUNDRY_BASE_URL:-https://4ka.inbicst.ru}
|
|
TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN:-}
|
|
TELEGRAM_CHAT_ID: ${TELEGRAM_CHAT_ID:-}
|
|
SLACK_WEBHOOK_URL: ${SLACK_WEBHOOK_URL:-}
|
|
ports:
|
|
- "${APP_PORT:-8000}:8000"
|
|
|
|
volumes:
|
|
db-data:
|