telecom-rag / scripts /setup-github.sh
Claude
chore: clean up repo for public portfolio presentation
280334f unverified
#!/bin/bash
# GitHub Repository Setup Script for Telecom RAG
set -e
echo "πŸš€ Setting up GitHub Repository for Telecom RAG"
echo "================================================"
echo ""
# Check if Git is configured
echo "πŸ“‹ Step 1: Checking Git Configuration"
if ! git config --global user.name &>/dev/null; then
echo "⚠️ Git user.name not configured"
read -p "Enter your name: " git_name
git config --global user.name "$git_name"
echo "βœ… Set user.name to: $git_name"
else
echo "βœ… Git user.name: $(git config --global user.name)"
fi
if ! git config --global user.email &>/dev/null; then
echo "⚠️ Git user.email not configured"
read -p "Enter your email: " git_email
git config --global user.email "$git_email"
echo "βœ… Set user.email to: $git_email"
else
echo "βœ… Git user.email: $(git config --global user.email)"
fi
echo ""
echo "πŸ“‹ Step 2: Initializing Git Repository"
if [ -d .git ]; then
echo "βœ… Git repository already initialized"
else
git init
echo "βœ… Initialized Git repository"
fi
echo ""
echo "πŸ“‹ Step 3: Verifying .gitignore"
if [ -f .gitignore ]; then
echo "βœ… .gitignore exists"
echo " Checking for .env..."
if grep -q "^\.env$" .gitignore; then
echo " βœ… .env is ignored (secrets safe)"
else
echo " ⚠️ Adding .env to .gitignore"
echo ".env" >> .gitignore
fi
else
echo "⚠️ Creating .gitignore"
cat > .gitignore << 'EOF'
__pycache__/
*.pyc
*.pyo
.env
venv/
env/
.DS_Store
google-cloud-sdk/
Docker.dmg
*.egg-info
dist/
build/
EOF
echo "βœ… Created .gitignore"
fi
echo ""
echo "πŸ“‹ Step 4: Adding Files to Git"
git add .
echo "βœ… Added all files (respecting .gitignore)"
echo ""
echo "πŸ“‹ Step 5: Creating Initial Commit"
if git rev-parse HEAD &>/dev/null; then
echo "βœ… Repository already has commits"
echo " Creating new commit with recent changes..."
git commit -m "feat: Update Telecom RAG with Cloud Run deployment
- Fixed .env configuration (removed quotes)
- Added OrbStack optimization
- Deployed to Cloud Run successfully
- Added comprehensive documentation
- 32,802 documents loaded
- Hybrid search enabled" || echo " ℹ️ No changes to commit"
else
git commit -m "feat: Initial commit - Telecom RAG System
- Hybrid search (BM25 + Dense + RRF)
- 32,802 telecom documents
- RAGAS evaluation metrics
- Cloud Run deployment ready
- OrbStack optimized
- Comprehensive documentation"
echo "βœ… Created initial commit"
fi
echo ""
echo "πŸ“‹ Step 6: GitHub Repository Setup"
echo ""
echo "Now you need to create a private repository on GitHub:"
echo ""
echo "1. Go to: https://github.com/new"
echo "2. Repository name: telecom-rag"
echo "3. Description: AI-powered Telecom Operations Assistant with RAG"
echo "4. Visibility: βœ… Private"
echo "5. Do NOT initialize with README, .gitignore, or license"
echo "6. Click 'Create repository'"
echo ""
read -p "Press Enter after creating the repository on GitHub..."
echo ""
read -p "Enter your GitHub repository URL (e.g., https://github.com/username/telecom-rag.git): " repo_url
echo ""
echo "πŸ“‹ Step 7: Adding Remote and Pushing"
git remote add origin "$repo_url" 2>/dev/null || git remote set-url origin "$repo_url"
echo "βœ… Added remote: $repo_url"
echo ""
echo "πŸš€ Pushing to GitHub..."
git branch -M main
git push -u origin main
echo ""
echo "βœ… Successfully pushed to GitHub!"
echo ""
echo "πŸ“Š Repository Summary:"
echo " URL: $repo_url"
echo " Branch: main"
echo " Visibility: Private"
echo ""
echo "πŸŽ‰ Done! Your code is now on GitHub."
echo ""
echo "πŸ’‘ Next Steps:"
echo " 1. Visit your repository: ${repo_url%.git}"
echo " 2. Add a README if needed"
echo " 3. Set up branch protection rules (optional)"
echo " 4. Add collaborators (optional)"