File size: 1,588 Bytes
2f203f5 6ee5066 2f203f5 6ee5066 2f203f5 6ee5066 2f203f5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | #!/bin/bash
# Helper script to deploy the explorer to Hugging Face Spaces from evals/deepeval_visualization
set -e
# Colors for output
BLUE='\033[0;34m'
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m'
echo -e "${BLUE}=== Data360-MCP HF Space Deployment (from evals/deepeval_visualization) ===${NC}"
# Navigate to deploy directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# Initialize git if not already a repo
if [ ! -d ".git" ]; then
git init -b main
git config user.name "Hugging Face Deployer"
git config user.email "deploy@huggingface.co"
fi
# Get HF remote URL
REMOTE_URL=$(git remote get-url space 2>/dev/null || true)
if [ -z "$REMOTE_URL" ]; then
read -p "Enter your Hugging Face Space Git URL (default: https://huggingface.co/spaces/rafmacalaba/data360-mcp-explorer): " USER_URL
if [ -z "$USER_URL" ]; then
USER_URL="https://huggingface.co/spaces/rafmacalaba/data360-mcp-explorer"
fi
git remote add space "$USER_URL"
echo -e "${GREEN}Added git remote 'space' pointing to $USER_URL${NC}"
else
echo -e "Found existing 'space' remote pointing to: $REMOTE_URL"
fi
# Ensure build artifacts and pycache are ignored
echo "Staging files..."
git add -A
# Stage and commit locally inside the deploy folder
git commit -m "Deploy explorer to Hugging Face Spaces" || echo "No changes to commit"
# Push to Hugging Face Space
echo -e "${BLUE}Pushing code to Hugging Face Space remote...${NC}"
git push --force space main
echo -e "${GREEN}Deployment complete! Your Space is building at: $REMOTE_URL${NC}"
|