[OPS] Автопуш SSOT в Gitea: ops/scripts/git_push.sh + Hermes каждые 30 минут
This commit is contained in:
1 parent
f5fd348304
commit
ae21c16cc8
1 file changed
+17
Executable
+17
@@ -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
|
||||
Reference in new issue
Block a user