fix(ci): robust prod deploy — remove dev-health gate, kill tier-clobbering sed, rm -f before recreate #758

Merged
jmiller merged 1 commits from fix/deploy-mokogitea-robustness into main 2026-07-06 15:57:54 +00:00
Owner

Repairs deploy-mokogitea.yml (prod deploy, on: push [main]) after it failed the #733 release and silently corrupted the shared compose. Three distinct false-negative / damage sources fixed:

1. Cross-tier false-negative gate (removed)

Step 0 "Verify dev environment is healthy" curled git.dev/api/healthz and exit 1 on failure — gating a PROD deploy on a live DEV health check. A transient dev blip false-negatives the prod deploy. Removed; the dev → rc → main pipeline + RC env is the real pre-prod gate.

2. Tier-clobbering sed (replaced with env-var pattern)

sed -i 's|mokogitea:[^ ]*|mokogitea:$TAG|' matched every mokogitea: line in the shared compose — it overwrote the dev and rc services' ${MOKOGITEA_DEV_TAG}/${MOKOGITEA_RC_TAG} env-vars with the prod tag (confirmed: dev+rc lines were clobbered to stable-289, dev container ended up running the prod image). Replaced with env $TAG_ENV="$TAG" docker compose up driving only the target service — no sed.

3. Container-name conflict (the actual failure)

docker compose up -d $CONTAINER without removing the fixed-name container + wrong compose project → Container name "/mokogitea" is already in use. Now: docker rm -f $CONTAINER + -p gitea-dev + --force-recreate.

Aligns deploy-mokogitea.yml with the already-fixed deploy-dev/deploy-rc pattern. The host compose was separately restored to env-var form for all three tiers (the bad run's damage). The #733 release itself is live + healthy (completed via manual fallback).

Long-term: cut over Template-Go#5 deploy-prod.yml to retire this custom copy. Refs #733, #752.

https://claude.ai/code/session_01Wsno14cxE49MstXFs9G5KT

Repairs `deploy-mokogitea.yml` (prod deploy, `on: push [main]`) after it failed the #733 release **and silently corrupted the shared compose**. Three distinct false-negative / damage sources fixed: ## 1. Cross-tier false-negative gate (removed) Step 0 "Verify dev environment is healthy" curled `git.dev/api/healthz` and `exit 1` on failure — **gating a PROD deploy on a live DEV health check.** A transient dev blip false-negatives the prod deploy. Removed; the `dev → rc → main` pipeline + RC env is the real pre-prod gate. ## 2. Tier-clobbering `sed` (replaced with env-var pattern) `sed -i 's|mokogitea:[^ ]*|mokogitea:$TAG|'` matched **every** `mokogitea:` line in the shared compose — it overwrote the **dev and rc** services' `${MOKOGITEA_DEV_TAG}`/`${MOKOGITEA_RC_TAG}` env-vars with the prod tag (confirmed: dev+rc lines were clobbered to `stable-289`, dev container ended up running the prod image). Replaced with `env $TAG_ENV="$TAG" docker compose up` driving **only the target service** — no sed. ## 3. Container-name conflict (the actual failure) `docker compose up -d $CONTAINER` without removing the fixed-name container + wrong compose project → `Container name "/mokogitea" is already in use`. Now: `docker rm -f $CONTAINER` + `-p gitea-dev` + `--force-recreate`. Aligns `deploy-mokogitea.yml` with the already-fixed `deploy-dev`/`deploy-rc` pattern. The **host compose was separately restored** to env-var form for all three tiers (the bad run's damage). The #733 release itself is live + healthy (completed via manual fallback). Long-term: cut over Template-Go#5 `deploy-prod.yml` to retire this custom copy. Refs #733, #752. https://claude.ai/code/session_01Wsno14cxE49MstXFs9G5KT
jmiller added 1 commit 2026-07-06 15:57:16 +00:00
fix(ci): robust prod deploy — drop dev-health gate, no tier-clobbering sed, rm -f before recreate
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 42s
Universal: PR Check / Branch Policy (pull_request) Successful in 1s
Universal: PR Check / Wiki Update Reminder (pull_request) Successful in 2s
Universal: PR Check / Validate PR (pull_request) Successful in 8s
Generic: Repo Health / Access control (pull_request) Successful in 2s
Generic: Repo Health / Site Health (pull_request) Has been skipped
Generic: Project CI / Lint & Validate (pull_request) Successful in 36s
Generic: Project CI / Tests (pull_request) Successful in 36s
Universal: PR Check / Secret Scan (pull_request) Successful in 56s
Universal: PR Check / Require Docs Update (pull_request) Failing after 1m11s
PR RC Release / Build RC Release (pull_request) Successful in 1m13s
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Generic: Repo Health / Scripts governance (pull_request) Has been cancelled
Generic: Repo Health / Repository health (pull_request) Has been cancelled
Generic: Repo Health / Report: Scripts Governance (pull_request) Has been cancelled
Generic: Repo Health / Report: Repository Health (pull_request) Has been cancelled
a7220ddb2b
The prod deploy (deploy-mokogitea.yml, on push to main) failed the #733 release and
silently corrupted the shared compose. Three fixes:
- Removed the 'Verify dev environment is healthy' gate: it curled git.dev and exit 1
  on failure, so a dev blip false-negatives the PROD deploy (wrong-tier gate; the
  dev->rc->main pipeline + RC env is the real gate).
- Replaced 'sed s|mokogitea:...|:$TAG|' (matched ALL mokogitea service lines and
  clobbered the dev+rc ${MOKOGITEA_*_TAG} env-vars with the prod tag) with the
  env-var pattern: env $TAG_ENV=$TAG docker compose up -- drives only the target
  service, no sed.
- Added 'docker rm -f $CONTAINER' + '-p gitea-dev' + '--force-recreate' before the
  compose up, fixing the 'Container name /mokogitea already in use' conflict.

Aligns deploy-mokogitea.yml with the fixed deploy-dev/deploy-rc pattern. Host compose
was separately restored to env-var form (the bad run had clobbered dev+rc tags).
Long-term: cut over Template-Go#5 deploy-prod.yml. Refs #733, #752.

Claude-Session: https://claude.ai/code/session_01Wsno14cxE49MstXFs9G5KT
Author
Owner

Wiki reminder: docs are wiki-first -- if this PR changes behavior, usage, config, or standards, please update the repo wiki before/after merge. (non-blocking)

<!-- wiki-reminder --> **Wiki reminder:** docs are wiki-first -- if this PR changes behavior, usage, config, or standards, please update the repo wiki before/after merge. _(non-blocking)_
jmiller merged commit 8242e5713a into main 2026-07-06 15:57:54 +00:00
jmiller deleted branch fix/deploy-mokogitea-robustness 2026-07-06 15:57:54 +00:00
Sign in to join this conversation.