games_app/deploy/gitea-stack/wait-ci.sh
Your Name e802ee23d5
Some checks failed
CI / test-and-build (push) Failing after 33s
Harden tloto-deploy and document Gitea CI/CD runbook
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-17 20:07:47 +02:00

18 lines
655 B
Bash

#!/usr/bin/env bash
set -euo pipefail
for i in $(seq 1 90); do
status="$(sudo -u postgres psql -d gitea -tAc 'SELECT status FROM action_run ORDER BY id DESC LIMIT 1')"
status="$(echo "$status" | tr -d '[:space:]')"
echo "poll $i status=$status"
# 3 success, 4 failure, 5 cancelled
if [[ "$status" == "3" || "$status" == "4" || "$status" == "5" ]]; then
sudo -u postgres psql -d gitea -c "SELECT id, left(title,50) AS title, status, started, stopped FROM action_run ORDER BY id DESC LIMIT 5;"
sudo docker logs tloto_act_runner --tail 50
exit 0
fi
sleep 10
done
echo "CI_TIMEOUT"
sudo docker logs tloto_act_runner --tail 80
exit 1