implement gitlab blue-green ci cd

This commit is contained in:
Meghdad committed 2026-07-23 08:17:56 +03:30
1 parent a353b80a15
commit 0f2dee08cb
13 files changed
+686 -230

No files matched your search

+22 -18
View File
@@ -623,27 +623,32 @@ Coverage is a guardrail, not proof of correctness. Important business scenarios
## 19. CI/CD decisions
GitHub Actions performs:
The canonical repository is hosted on the self-managed GitLab instance, so
GitLab CI is the authoritative pipeline. Merge requests and the protected default
branch run:
1. dependency installation;
2. Ruff lint and formatting verification;
3. strict mypy type checking;
4. unit and integration tests;
5. coverage artifact generation;
6. Docker image build;
7. optional SonarQube scan with quality-gate waiting.
1. Ruff lint and formatting verification;
2. strict mypy type checking;
3. unit, API, adapter, and real-Redis tests;
4. the 85% coverage gate and report generation;
5. optional SonarQube analysis with a blocking quality gate when configured;
6. an unprivileged container build;
7. immutable release packaging and SHA-256 generation.
The image is built but not automatically pushed or deployed because no registry, environment, release policy, or deployment authorization was supplied.
Every successful protected `main` pipeline deploys automatically. CI uploads the
verified source artifact over pinned-host-key SSH to a restricted deployment
account. A root-owned wrapper validates the artifact and performs the only
privileged operations.
Production delivery should add:
Production uses two fixed loopback slots. The candidate is built and started in
the inactive slot; Nginx switches its dedicated upstream only after readiness
succeeds. The former slot remains available until public HTTPS health, OpenAPI,
and repeatable demo-allocation smoke tests pass. Any failure restores the old
upstream and removes the candidate.
- a locked dependency process;
- software-bill-of-materials generation;
- dependency and container vulnerability scanning;
- signed images;
- registry push for protected branches/tags;
- staged deployment;
- smoke tests and automated rollback.
The project registry is not currently configured, so production builds the
verified source artifact while the old slot continues serving. A future registry
can replace this with build-once image promotion and signed images.
## 20. Security decisions
@@ -692,4 +697,3 @@ Before production rollout, the following decisions remain:
10. Define authentication and authorization for every endpoint.
These are intentionally documented rather than hidden behind placeholder code. Each one can materially change correctness, operations, or business behavior.