Three changes:
1. Skip GH-Actions-only Dependabot PRs (dependabot/github_actions/*) in
deploy-preview — there is no app image to preview, and these PRs were
landing phantom containers with mismatched ports.
2. Use per-PR env files (staging-pr-{N}.env) instead of the shared
staging.env for preview deploys and teardowns. Concurrent SCP transfers
to the same filename were overwriting each other, causing wrong
JOURNAL_HOST_PORT / JOURNAL_IMAGE_TAG values to be used.
3. Serialize server-side deploy operations with a flock on
/tmp/trails-preview-deploy.lock (300s timeout). Eviction + compose up
must be atomic; without the lock, two simultaneous jobs could both see
"3 active previews" and both evict different projects, or one could
start compose up against a just-evicted env.
Triggered by a Dependabot batch today (PRs 371-373) that opened
simultaneously and produced a phantom trails-pr-371 container running
the pr-370 image on port 3940 while the Caddyfile expected 3942,
causing sustained 502s on pr-371.staging.trails.cool.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| workflows | ||
| copilot-instructions.md | ||
| dependabot.yml | ||