Files
co-lite/openspec/changes/add-release-ci-packaging/tasks.md
T

50 lines
3.3 KiB
Markdown

# Tasks
Design: `design.md`. All tasks run serially: each touches a build file, CI or SQL.
## 1. Images and database package
- [x] 1.1 Make the images production-safe (design decisions 4 and 5).
- Add a `.dockerignore` to each of the nine modules that lacks one.
- Check each Dockerfile for baked-in config or secrets.
- Write `local/image-check.sh <image>`. It fails when an image holds `appkeys.json`, `.env`, `*.pem`, `*.p12` or a Google service-account JSON.
Tests first: build one image with a planted `appkeys.json` in its module folder and show the check fails (red). Add the `.dockerignore` and show it passes (green). Then build all nine images locally, and run the check on each.
- The check also fails on a secret-named setting (KEY, SECRET, PASSWORD, PWD, TOKEN) that has a built-in default in the jar's config. It found one: `SMSS360_APIKEY` in service-email carried a real-looking key as its default, which is now removed. That key is in git history, so it must be rotated outside this change.
- Scope: `solvway-*/Dockerfile`, `solvway-*/.dockerignore`, `local/image-check.sh`, `solvway-services-email/src/main/resources/application.yml` (the key default only)
- Verify: all nine `docker build` commands succeed, and `local/image-check.sh` passes on each image.
- [x] 1.2 Write the production database package (design decision 6): `sql/00` to `04` with source headers.
Prove it: load `00` to `04` into a throwaway MySQL 8 container (not the dev database). For `04`, use a hash of a throwaway password. Point the local stack at it, then show:
- the services start;
- no `admin` row has the dev password hash;
- signing in as the new admin is sent to the password change.
- Diff the package against `local/seed/` and record the only differences: the dev admin rows removed and file `04` added.
- Scope: `openspec/changes/add-release-ci-packaging/sql/**`
- Verify: the throwaway-database check above.
## 2. CI
- [x] 2.1 Add `.gitea/workflows/ci.yml` (design decisions 1 to 3 and 5).
- The workflow runs on push to `main` only.
- It runs Maven `verify` with `-T 1C`, then builds all nine images, runs `local/image-check.sh` on each, and pushes after every image has built, tagged with the SHA and `latest`.
- It logs in to the registry with `PACKAGE_USER` and `PACKAGE_RW_KEY`.
Before merge: lint the workflow with `actionlint`, or a YAML parse if `actionlint` is unavailable. Dry-run the build-and-check part of the job locally with the same commands, without the push.
- Scope: `.gitea/workflows/**`
- Verify: the local dry-run builds and checks all nine images. The first real run and push happen after the repo moves to `solvway`.
## 3. Handover
- [ ] 3.1 Write `docs/deployment.md` (design decision 7).
- Cross-check every environment variable against each module's `application.yml`, the portal's `process.env` uses and the gateway's `appkeys.json` path, so none is missing or extra.
- Secret templates use placeholders only, never real values.
- Scope: `docs/deployment.md`
- Verify: a script lists the variables each module reads and finds each one in the document.
## Workflow follow-up
- Whole-branch review, push, PR to main and merge, then archive on its own branch.
- After the repo moves to `solvway`: confirm the `PACKAGE_USER` and `PACKAGE_RW_KEY` secrets and a runner, then check that the first `main` run pushes the nine SHA tags.