Files
true-recall/push-all.sh

73 lines
1.8 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
#
# push-all.sh - Push TrueRecall v2 to all remotes
#
# Usage: ./push-all.sh [commit-message]
# If commit-message provided, will commit first
#
set -e
REPO_DIR="/root/.openclaw/workspace/.main_projects/true-recall-v2"
cd "$REPO_DIR"
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo "=========================================="
echo "TrueRecall v2 - Push to All Remotes"
echo "=========================================="
# Optional: commit if message provided
if [ -n "$1" ]; then
echo -e "${YELLOW}Committing changes...${NC}"
git add -A
git commit -m "$1" || echo "Nothing to commit"
fi
# Check for uncommitted changes
if ! git diff-index --quiet HEAD --; then
echo -e "${YELLOW}Warning: You have uncommitted changes${NC}"
echo "Run: git add -A && git commit -m 'your message'"
echo "Or: ./push-all.sh 'your commit message'"
exit 1
fi
# Push to each remote
# GitHub currently blocked/deactivated - update when ready
remotes=("gitea" "gitlab")
echo "Note: GitHub remote exists but is currently skipped (blocked/deactivated)."
failed=()
for remote in "${remotes[@]}"; do
echo ""
echo -e "${YELLOW}Pushing to $remote...${NC}"
if git push "$remote" main; then
echo -e "${GREEN}$remote pushed successfully${NC}"
else
echo -e "${RED}$remote push failed${NC}"
failed+=("$remote")
fi
done
# Summary
echo ""
echo "=========================================="
if [ ${#failed[@]} -eq 0 ]; then
echo -e "${GREEN}All remotes pushed successfully!${NC}"
else
echo -e "${RED}Failed to push to: ${failed[*]}${NC}"
echo "You may need to authenticate or fix network issues."
fi
echo "=========================================="
# Show current remotes
echo ""
echo "Current remotes:"
git remote -v