chore: update agent rules, skills and workflows

This commit is contained in:
Zuev
2026-02-19 20:33:47 +03:00
parent 64d85eab55
commit ed8668c599
7 changed files with 123 additions and 123 deletions

View File

@@ -1,24 +1,17 @@
#!/bin/bash
# --- НАСТРОЙКИ ---
SERVER="root@192.168.1.87"
REMOTE_PATH="/root/magistr/program"
# -----------------
echo "📡 Checking for updates locally..."
echo "📡 Connecting to remote server ($SERVER)..."
# 1. Запускаем fetch прямо на сервере
# Флаг -o BatchMode=yes запрещает спрашивать пароль (чтобы скрипт не завис)
ssh -o BatchMode=yes -o ConnectTimeout=10 "$SERVER" "cd $REMOTE_PATH && git fetch origin"
# 1. Запускаем fetch локально
git fetch origin
if [ $? -ne 0 ]; then
echo "❌ Connection failed."
echo "Make sure SSH keys are set up and the server is reachable."
echo "❌ Fetch failed. Check your internet connection and git remote settings."
exit 1
fi
# 2. Проверяем количество новых коммитов (HEAD..@{u})
BEHIND_COUNT=$(ssh "$SERVER" "cd $REMOTE_PATH && git rev-list --count HEAD..@{u} 2>/dev/null")
BEHIND_COUNT=$(git rev-list --count HEAD..@{u} 2>/dev/null)
# Если переменная пустая — значит ошибка в гите
if [ -z "$BEHIND_COUNT" ]; then
@@ -28,16 +21,16 @@ fi
# 3. Логика обновления
if [ "$BEHIND_COUNT" -gt 0 ]; then
echo "⬇️ Found $BEHIND_COUNT new commit(s). Pulling on server..."
echo "⬇️ Found $BEHIND_COUNT new commit(s). Pulling changes..."
# Выполняем git pull на сервере
ssh "$SERVER" "cd $REMOTE_PATH && git pull"
# Выполняем git pull
git pull
if [ $? -eq 0 ]; then
echo "✅ Server successfully updated!"
echo "✅ Successfully updated!"
else
echo "❌ Update failed (merge conflicts?)."
fi
else
echo "✨ Server is already up to date."
echo "✨ Already up to date."
fi