mosdns/build-vue.sh
dengxiongjian ee06785e08
Some checks are pending
Test mosdns / build (push) Waiting to run
开发web管理
2025-10-15 22:20:27 +08:00

53 lines
1.1 KiB
Bash
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
set -e
echo ""
echo "===================================="
echo " MosDNS Vue 版本构建脚本"
echo "===================================="
echo ""
echo "[1/3] 检查 Node.js 环境..."
if ! command -v node &> /dev/null; then
echo "❌ 错误: 未找到 Node.js"
echo "请先安装 Node.js: https://nodejs.org/"
exit 1
fi
echo "✅ Node.js 已安装"
echo ""
echo "[2/3] 构建 Vue 前端..."
cd web-ui
if [ ! -d "node_modules" ]; then
echo "📦 首次构建,正在安装依赖..."
npm install
fi
echo "🔨 正在构建 Vue 项目..."
npm run build
echo "✅ Vue 构建完成"
cd ..
echo ""
echo "[3/3] 构建 Go 后端..."
echo "🔨 正在编译 Go 程序..."
go build -o dist/mosdns-vue .
echo "✅ Go 编译完成"
echo ""
echo "===================================="
echo " ✅ 构建完成!"
echo "===================================="
echo ""
echo "可执行文件: dist/mosdns-vue"
echo ""
echo "运行命令:"
echo " ./dist/mosdns-vue start -c config.yaml"
echo ""
echo "然后访问: http://localhost:5555"
echo ""