Files
root ae21c16cc8
lint / hygiene (push) Failing after 15s
standard / check (push) Successful in 8s
[OPS] Автопуш SSOT в Gitea: ops/scripts/git_push.sh + Hermes каждые 30 минут
2026-11-17 18:10:16 +03:00

18 lines
601 B
Bash
Executable File

#!/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