mosdns/Gitea.sh

111 lines
2.5 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

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
# ========================================
# 推送更新到 Gitea
# ========================================
echo "========================================="
echo " 📦 准备推送到 Gitea"
echo "========================================="
echo ""
# 检查是否已初始化 git
if [ ! -d ".git" ]; then
echo "初始化 Git 仓库..."
git init
git config user.name "dengxiongjian"
git config user.email "dengxiongjian@ylcomm.cn"
fi
# 检查远程仓库
if ! git remote | grep -q origin; then
echo "添加远程仓库..."
git remote add origin https://git.ylcomm.cn/dengxiongjian/mosdns.git
else
echo "远程仓库已存在,更新 URL..."
git remote set-url origin https://git.ylcomm.cn/dengxiongjian/mosdns.git
fi
echo ""
echo "📋 当前远程仓库:"
git remote -v
echo ""
# 查看状态
echo "📊 Git 状态:"
git status --short | head -20
echo ""
# 添加文件
echo "📁 添加文件..."
git add .
echo ""
echo "📝 准备提交的文件:"
git status --short | grep "^[AM]" | wc -l
echo "个文件将被提交"
echo ""
# 提交
read -p "输入提交信息 (直接回车使用默认): " COMMIT_MSG
if [ -z "$COMMIT_MSG" ]; then
COMMIT_MSG="更新: YLTX-MosDNS v1.0.0 完整版
新增功能:
- 智能防污染系统 (smart_fallback)
- Web 管理界面 (Vue 3 + TypeScript)
- 配置热加载 (HotReloadManager)
- 一键部署 (init 命令)
- 智能拓扑排序 (支持任意配置顺序)
- 完整的 RESTful API
- 规则管理优化
文档更新:
- README.md 完全重写
- 新增 CHANGELOG.md
- 新增多份部署指南
- 新增 Gitea 发布指南
详见 CHANGELOG.md"
fi
echo ""
echo "提交信息:"
echo "$COMMIT_MSG"
echo ""
git commit -m "$COMMIT_MSG"
echo ""
read -p "是否推送到 Gitea(y/N): " PUSH
if [[ "$PUSH" =~ ^[Yy]$ ]]; then
echo ""
echo "🚀 推送到 Gitea..."
git branch -M main
git push -u origin main
if [ $? -eq 0 ]; then
echo ""
echo "========================================="
echo " ✅ 推送成功!"
echo "========================================="
echo ""
echo "🌐 访问仓库:"
echo " https://git.ylcomm.cn/dengxiongjian/mosdns"
echo ""
else
echo ""
echo "❌ 推送失败,请检查网络和权限"
fi
else
echo ""
echo "⏸️ 已取消推送"
echo ""
echo "稍后可以手动推送:"
echo " git push -u origin main"
fi
echo ""
echo "========================================="