fix(deploy): write status before self-restarting deploy-hook

The deploy-hook container was killing itself before write_status ran,
leaving last_deploy=null on every successful deploy. Move health check
and write_status before the detached nohup restart of the deploy-hook
container so status is persisted even when the container recreates itself.

Co-Authored-By: Paperclip <[email protected]>
This commit is contained in:
XikaandPaperclip committed 2026-07-01 01:02:00 +00:00
1 parent df016a1e34
commit c281b2b56d
1 file changed
+3 -3
+3 -3
View File
@@ -56,10 +56,10 @@ log "Building API + worker ($GIT_SHA)"
log "Building admin UI ($GIT_SHA)"
$COMPOSE build --build-arg GIT_SHA="$GIT_SHA" web
$COMPOSE up -d --force-recreate web
log "Refreshing deploy-hook"
$COMPOSE build deploy-hook
$COMPOSE up -d --force-recreate deploy-hook
curl -sf --max-time 10 http://127.0.0.1:8000/api/health >/dev/null
write_status "ok $GIT_SHA $(date -Iseconds)"
log "Deploy OK ($GIT_SHA)"
log "Refreshing deploy-hook (self-restart — runs detached)"
$COMPOSE build deploy-hook
nohup $COMPOSE up -d --force-recreate deploy-hook &
} >> "$LOG_FILE" 2>&1