fix(deploy): restore previous release on failure

This commit is contained in:
cesnimda
2026-08-31 11:57:03 +02:00
parent b9e703ee7c
commit 5f0c0b0549
5 changed files with 62 additions and 8 deletions
+9
View File
@@ -270,6 +270,15 @@ docker compose start backend
This is the usual fix for a bad deploy, and it **does not touch the database**.
Normal deployments tag backend and frontend images with `APP_COMMIT_SHA` and retain the images from
the currently running containers as `jobtracker-backend:previous` and `jobtracker-frontend:previous`.
If any step fails after core replacement—including public liveness, readiness, or auth-configuration
checks—`deploy.sh` automatically recreates both core services from those retained images and still
returns a failed status so CI reports the rejected release. The previous images are replaced only at
the start of the next deployment.
Use the manual procedure below if automatic restoration itself fails or an older release is required.
```bash
cd /opt/job-tracker/app # the deployment checkout
git log --oneline -5 # find the last good commit