diff --git a/docs/deployment.md b/docs/deployment.md index 3db5086..18b9136 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -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/-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 | |---|---| diff --git a/openspec/changes/add-release-ci-packaging/.openspec.yaml b/openspec/changes/archive/2026-11-30-add-release-ci-packaging/.openspec.yaml similarity index 100% rename from openspec/changes/add-release-ci-packaging/.openspec.yaml rename to openspec/changes/archive/2026-11-30-add-release-ci-packaging/.openspec.yaml diff --git a/openspec/changes/add-release-ci-packaging/design.md b/openspec/changes/archive/2026-11-30-add-release-ci-packaging/design.md similarity index 100% rename from openspec/changes/add-release-ci-packaging/design.md rename to openspec/changes/archive/2026-11-30-add-release-ci-packaging/design.md diff --git a/openspec/changes/add-release-ci-packaging/proposal.md b/openspec/changes/archive/2026-11-30-add-release-ci-packaging/proposal.md similarity index 100% rename from openspec/changes/add-release-ci-packaging/proposal.md rename to openspec/changes/archive/2026-11-30-add-release-ci-packaging/proposal.md diff --git a/openspec/changes/add-release-ci-packaging/specs/release-packaging/spec.md b/openspec/changes/archive/2026-11-30-add-release-ci-packaging/specs/release-packaging/spec.md similarity index 100% rename from openspec/changes/add-release-ci-packaging/specs/release-packaging/spec.md rename to openspec/changes/archive/2026-11-30-add-release-ci-packaging/specs/release-packaging/spec.md diff --git a/openspec/changes/add-release-ci-packaging/sql/00-schemas.sql b/openspec/changes/archive/2026-11-30-add-release-ci-packaging/sql/00-schemas.sql similarity index 100% rename from openspec/changes/add-release-ci-packaging/sql/00-schemas.sql rename to openspec/changes/archive/2026-11-30-add-release-ci-packaging/sql/00-schemas.sql diff --git a/openspec/changes/add-release-ci-packaging/sql/01-schema.sql b/openspec/changes/archive/2026-11-30-add-release-ci-packaging/sql/01-schema.sql similarity index 100% rename from openspec/changes/add-release-ci-packaging/sql/01-schema.sql rename to openspec/changes/archive/2026-11-30-add-release-ci-packaging/sql/01-schema.sql diff --git a/openspec/changes/add-release-ci-packaging/sql/02-reference.sql b/openspec/changes/archive/2026-11-30-add-release-ci-packaging/sql/02-reference.sql similarity index 100% rename from openspec/changes/add-release-ci-packaging/sql/02-reference.sql rename to openspec/changes/archive/2026-11-30-add-release-ci-packaging/sql/02-reference.sql diff --git a/openspec/changes/add-release-ci-packaging/sql/03-colite.sql b/openspec/changes/archive/2026-11-30-add-release-ci-packaging/sql/03-colite.sql similarity index 100% rename from openspec/changes/add-release-ci-packaging/sql/03-colite.sql rename to openspec/changes/archive/2026-11-30-add-release-ci-packaging/sql/03-colite.sql diff --git a/openspec/changes/add-release-ci-packaging/sql/04-first-admin.sql b/openspec/changes/archive/2026-11-30-add-release-ci-packaging/sql/04-first-admin.sql similarity index 100% rename from openspec/changes/add-release-ci-packaging/sql/04-first-admin.sql rename to openspec/changes/archive/2026-11-30-add-release-ci-packaging/sql/04-first-admin.sql diff --git a/openspec/changes/add-release-ci-packaging/tasks.md b/openspec/changes/archive/2026-11-30-add-release-ci-packaging/tasks.md similarity index 100% rename from openspec/changes/add-release-ci-packaging/tasks.md rename to openspec/changes/archive/2026-11-30-add-release-ci-packaging/tasks.md diff --git a/openspec/specs/release-packaging/spec.md b/openspec/specs/release-packaging/spec.md new file mode 100644 index 0000000..abaee6f --- /dev/null +++ b/openspec/specs/release-packaging/spec.md @@ -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