Files
eSIM-Tools/scripts/deploy.sh
Abner c5fbc34d0a 🏗️ Major project restructure and CSP fix
🔧 Fixed CSP Issue:
- Root cause: Netlify CSP configuration overriding HTML meta CSP
- Added missing domains: id.giffgaff.com, publicapi.giffgaff.com
- Updated netlify.toml CSP configuration
- This resolves the OAuth token exchange CSP violation

📁 Project Architecture Restructure:
- src/: Source code organized by provider (giffgaff/, simyo/)
- docs/: Documentation categorized (fixes/, guides/, reference/)
- tests/: All test files centralized
- scripts/: Deployment and utility scripts
- postman/: API collections and reference files

🔄 Path Updates:
- Updated netlify.toml redirects for new file locations
- Updated README.md with new project structure
- Updated all internal documentation links
- Maintained backward compatibility for all URLs

📋 Files Moved:
- giffgaff_complete_esim.html → src/giffgaff/
- simyo_complete_esim.html → src/simyo/
- simyo_static.html → src/simyo/
- simyo_proxy_server.js → src/simyo/
- All docs → docs/{fixes,guides,reference}/
- All tests → tests/
- All scripts → scripts/
- Postman collections → postman/

 Benefits:
- Improved maintainability and organization
- Better separation of concerns
- Enhanced developer experience
- Cleaner project structure following best practices
- Zero impact on user experience (all URLs preserved)

This major restructure sets foundation for better scalability and maintenance.
2025-08-01 19:28:03 +08:00

72 lines
2.2 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# eSIM工具自动部署脚本
echo "🚀 开始部署eSIM工具..."
# 检查是否在正确的目录
if [ ! -f "netlify.toml" ]; then
echo "❌ 错误: 未找到netlify.toml文件请确保在项目根目录运行此脚本"
exit 1
fi
# 检查Git是否初始化
if [ ! -d ".git" ]; then
echo "📦 初始化Git仓库..."
git init
git add .
git commit -m "Initial commit: eSIM Tools with Netlify deployment"
echo "📋 请设置远程仓库:"
echo " git remote add origin https://github.com/your-username/esim-tools.git"
echo " git push -u origin main"
echo ""
echo "然后在Netlify中连接此仓库进行自动部署"
else
echo "📦 更新Git仓库..."
git add .
# 检查是否有变更
if git diff --cached --quiet; then
echo " 没有文件变更,跳过提交"
else
echo "请输入提交信息 (默认: Update eSIM tools):"
read -r commit_message
commit_message=${commit_message:-"Update eSIM tools"}
git commit -m "$commit_message"
# 推送到远程仓库
if git remote get-url origin > /dev/null 2>&1; then
echo "📤 推送到远程仓库..."
git push
else
echo "⚠️ 未设置远程仓库,请手动设置:"
echo " git remote add origin https://github.com/your-username/esim-tools.git"
echo " git push -u origin main"
fi
fi
fi
echo ""
echo "✅ 部署准备完成!"
echo ""
echo "📋 Netlify部署步骤:"
echo "1. 登录 https://app.netlify.com"
echo "2. 点击 'New site from Git'"
echo "3. 选择您的Git仓库"
echo "4. 构建设置:"
echo " - Build command: echo 'No build needed'"
echo " - Publish directory: ."
echo "5. 点击 'Deploy site'"
echo ""
echo "🌐 域名配置:"
echo "- 在Netlify站点设置中添加自定义域名: esim.yyxx.com"
echo "- 配置DNS记录指向Netlify"
echo ""
echo "🔗 访问路径:"
echo "- 主页: https://esim.yyxx.com/"
echo "- Giffgaff工具: https://esim.yyxx.com/giffgaff"
echo "- Simyo工具: https://esim.yyxx.com/simyo"
echo ""
echo "📚 更多信息请参考 DEPLOYMENT_GUIDE.md"