Files
microdao-daarion/scripts/git-sync-all.sh
Apple 744c149300
Some checks failed
Build and Deploy Docs / build-and-deploy (push) Has been cancelled
Add automated session logging system
- Created logs/ structure (sessions, operations, incidents)
- Added session-start/log/end scripts
- Installed Git hooks for auto-logging commits/pushes
- Added shell integration for zsh
- Created CHANGELOG.md
- Documented today's session (2026-01-10)
2026-01-10 04:53:17 -08:00

68 lines
2.3 KiB
Bash
Executable File

#!/bin/bash
# ============================================================
# git-sync-all.sh - Синхронізація на всі Git репозиторії
# ============================================================
# Автоматично push на:
# - GitHub (origin)
# - Gitea (локальний, localhost:3000)
# - GitLab (NODE3, через SSH tunnel)
# ============================================================
set -e
PROJECT_DIR="/Users/apple/github-projects/microdao-daarion"
cd "$PROJECT_DIR"
# Кольори
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m'
echo -e "${GREEN}🔄 Git Sync All Remotes${NC}"
echo "================================"
date
echo ""
# Поточна гілка
BRANCH=$(git branch --show-current)
echo -e "📌 Гілка: ${YELLOW}$BRANCH${NC}"
echo ""
# 1. Push на GitHub (origin)
echo -e "${GREEN}1. GitHub (origin)${NC}"
if git push origin "$BRANCH" 2>/dev/null; then
echo " ✅ GitHub OK"
else
echo -e " ${RED}❌ GitHub FAILED${NC}"
fi
# 2. Push на Gitea (локальний)
echo -e "${GREEN}2. Gitea (localhost:3000)${NC}"
if git push gitea "$BRANCH" 2>/dev/null; then
echo " ✅ Gitea OK"
else
echo -e " ${YELLOW}⚠️ Gitea - можливо потрібен логін${NC}"
# Спробуємо з credentials
git push http://daarion-admin:DaarionGit2026!@localhost:3000/daarion-admin/microdao-daarion.git "$BRANCH" 2>/dev/null && echo " ✅ Gitea OK (з credentials)" || echo -e " ${RED}❌ Gitea FAILED${NC}"
fi
# 3. Push на GitLab (NODE3)
echo -e "${GREEN}3. GitLab (NODE3)${NC}"
# Перевірка чи є SSH tunnel
if nc -z localhost 8929 2>/dev/null; then
if git push gitlab "$BRANCH" 2>/dev/null; then
echo " ✅ GitLab OK"
else
# Спробуємо з credentials
git push http://root:glpat-daarion-gitlab-2026@localhost:8929/root/microdao-daarion.git "$BRANCH" 2>/dev/null && echo " ✅ GitLab OK (з credentials)" || echo -e " ${RED}❌ GitLab FAILED${NC}"
fi
else
echo -e " ${YELLOW}⚠️ GitLab недоступний. Запустіть SSH tunnel:${NC}"
echo " ssh -p 33147 -L 8929:localhost:8929 zevs@80.77.35.151"
fi
echo ""
echo "================================"
echo -e "${GREEN}✅ Синхронізація завершена${NC}"