fix(deploynotify): read commit SHA from Coolify SOURCE_COMMIT runtime env

Baking SOURCE_COMMIT as a Docker build arg never worked: Coolify exposes it
as a runtime env var, not a build arg, so gitSHA was always empty and the owner
DM was skipped. Read SOURCE_COMMIT from the container env at startup (falling
back to the ldflags-baked gitSHA for local builds), forward it via the compose
environment, and drop the dead build-arg baking.
This commit is contained in:
2026-06-28 23:08:17 +07:00
parent 1fa549fa18
commit 0abd33cb42
6 changed files with 55 additions and 22 deletions
+5 -4
View File
@@ -88,10 +88,11 @@ SSM/AWS lookup that fails with no AWS creds and bricks startup), `KV_PROVIDER`,
bot token; a second poller gets HTTP 409, and a second in-process scheduler
double-fires crons. Prefer **stop-first redeploys** so two containers never
overlap near a cron time.
5. **Build arg for deploynotify:** Coolify sets `SOURCE_COMMIT` automatically
and the compose build forwards it, so the owner gets the "new version" DM
with no manual wiring. Without it, `deploynotify` stays silent (no crash) —
but you lose that notification.
5. **deploynotify commit SHA:** Coolify injects `SOURCE_COMMIT` (a predefined
runtime env var) into the container, and the compose `environment` forwards
it, so the bot reads it at startup and DMs the owner the "new version"
notice — no manual wiring. Without it, `deploynotify` stays silent (no
crash) — but you lose that notification.
6. **Health check:** use Coolify's HTTP monitor against `GET /` (returns
`text/plain` `miti99bot ok`). Do **not** use a compose `healthcheck` — the
distroless image has no shell/curl and `cmd/server` has no `-healthcheck`