[OPS] Автопуш SSOT в Gitea: ops/scripts/git_push.sh + Hermes каждые 30 минут
lint / hygiene (push) Failing after 15s
standard / check (push) Successful in 8s

This commit is contained in:
root committed 2026-11-17 18:10:16 +03:00
1 parent f5fd348304
commit ae21c16cc8
1 file changed
+17
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
# Пуш коммитов SSOT в Gitea. Запускается Hermes каждые 30 минут.
set -u
cd /root/buryan-infra || exit 1
AHEAD=$(git rev-list --count origin/main..HEAD 2>/dev/null || echo 0)
if [ "$AHEAD" -gt 0 ]; then
if git push origin main >>/var/log/hub/git-push.log 2>&1; then
echo "pushed $AHEAD"
else
echo "push failed"
/usr/bin/python3 /opt/buryan-hub/scripts/notify.py --priority high \
--title "Gitea: пуш не удался" "Коммитов впереди: $AHEAD" >/dev/null 2>&1 || true
exit 1
fi
else
echo "ok (0 ahead)"
fi