Compare commits

..
Author SHA1 Message Date
ngqileandClaude Opus 5.5 eadcbba279 docs(openspec): archive add-release-ci-packaging
Adds the release-packaging main spec and points the handover at the
archived SQL package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-30 10:22:49 +08:00
ngqile c293ae12b3 Merge pull request 'feat: CI image publishing, production DB package and deployment handover (change 5)' (#13) from add-release-ci-packaging into main
CI / build-and-publish (push) Failing after 0s
2026-11-30 02:22:36 +00:00
12 changed files with 64 additions and 2 deletions

No files matched your search

+2 -2
View File
@@ -2,7 +2,7 @@
This is for whoever deploys Co-Lite to the Kubernetes cluster. CI builds and publishes the images. The deployer writes the manifests and rolls them out. The database package goes to the DBA.
Spec: `openspec/specs/release-packaging/spec.md` (until the change is archived: `openspec/changes/add-release-ci-packaging/specs/release-packaging/spec.md`). Local stack for comparison: `local/README.md`.
Spec: `openspec/specs/release-packaging/spec.md`. Local stack for comparison: `local/README.md`.
## 1. Images
@@ -53,7 +53,7 @@ The Service names matter:
**Connections:** the services connect without TLS (`useSSL=false` in their datasource URL), so the server must accept non-TLS connections from the cluster. To require TLS instead, override `SPRING_DATASOURCE_URL` on each database service.
**Package:** this package sets up an empty server once. Later changes ship their own SQL, which is applied on top of it. The files are in `openspec/changes/add-release-ci-packaging/sql/`. After the change is archived, it is under `openspec/changes/archive/<date>-add-release-ci-packaging/sql/`. Run the files in this order, on an empty server:
**Package:** this package sets up an empty server once. Later changes ship their own SQL, which is applied on top of it. The files are in `openspec/changes/archive/2026-11-30-add-release-ci-packaging/sql/`. Run the files in this order, on an empty server:
| File | What it does |
|---|---|
+62
View File
@@ -0,0 +1,62 @@
# release-packaging Specification
## Purpose
Releases are built, tested and published as container images that someone else can deploy, and the production database can be created from a package that holds no development credentials.
## Requirements
### Requirement: Images published from main
Every push to `main` SHALL build the eight backend services and the admin portal, run their tests, and push one image per module to `gitea.containerverse.dev`, tagged with the commit SHA and with `latest`.
#### Scenario: Green push publishes all images
- **GIVEN** a push to `main` whose build and tests pass
- **WHEN** CI finishes
- **THEN** the registry holds the nine images tagged with that commit's SHA
- **AND** `latest` points at the same images
#### Scenario: Red test publishes nothing
- **GIVEN** a push to `main` with a failing test in any module
- **WHEN** CI runs
- **THEN** the run fails
- **AND** no image is pushed for that commit
#### Scenario: Other branches do not publish
- **WHEN** a commit is pushed to a branch other than `main`
- **THEN** no image is pushed
### Requirement: Images carry no secrets or environment config
Images SHALL contain no secrets, keys or passwords, and no setting whose name marks it as a secret SHALL have a built-in default value. Every service MUST read its database, Redis, gateway, Pub/Sub, JWT and API-key settings from environment variables or mounted files at runtime, and any other environment-specific value baked into an image MUST be overridable by an environment variable.
#### Scenario: Image layers hold no key material
- **WHEN** a published image's files are inspected
- **THEN** there is no `.env` file, `appkeys.json`, Pub/Sub service-account key or private key in it
#### Scenario: One image runs in any environment
- **GIVEN** the same image tag
- **WHEN** it is started with a different set of environment variables and mounted files
- **THEN** it connects to the database, Redis and other services those settings name
### Requirement: Production database package has no development login
The production database package SHALL create the five schemas, their tables, the reference data, the Co-Lite company, the new lead tables and the back-office modules. It MUST NOT create any user with a known password. The first administrator MUST be created from a password hash the operator supplies, and MUST be forced to change the password at first sign-in.
#### Scenario: Package applied to an empty server
- **GIVEN** an empty MySQL 8 server
- **WHEN** the DBA runs the package files in the documented order
- **THEN** every service starts against it
- **AND** no `admin` user with the development password exists
#### Scenario: First administrator signs in
- **GIVEN** the first-admin template applied with an operator-generated bcrypt hash
- **WHEN** that administrator signs in to the admin portal
- **THEN** they are sent to change their password before any other screen