Bläddra i källkod

feat: 删除冗余脚本文件;

liujia 2 månader sedan
förälder
incheckning
ac4f1647fd
3 ändrade filer med 0 tillägg och 131 borttagningar
  1. 0 11
      .env.integrated
  2. 0 71
      deploy.ps1
  3. 0 49
      merge_dev_to_pro.sh

+ 0 - 11
.env.integrated

@@ -1,11 +0,0 @@
-VITE_ENV=production
-VITE_APP_TITLE="合肥雷能信息技术有限公司"
-VITE_STOTRE_NAME=LEINENG_WEB
-# 集成环境服务器 47.121.135.46
-# 接口配置
-VITE_APP_HOST=https://47.121.135.46:30085
-VITE_API_BASE_URL=/portal-service-server/web 
-# mqtt配置
-VITE_MQTT_HOST=ws://47.121.135.46:1883/mqtt
-VITE_MQTT_USERNAME=admin
-VITE_MQTT_PASSWORD=public

+ 0 - 71
deploy.ps1

@@ -1,71 +0,0 @@
-# 前端部署脚本
-# 日期:2025-08-07
-
-# ========== 🛠️ 配置参数 ==========
-$sourceDir = "D:\project\ln-web\dist"
-$remoteUser = "liujia"
-$remoteIP = "43.137.10.199"
-$remotePath = "/work/web/dist" # 实际路径  /work/web/dist
-$sshPort = 22
-
-# === 准备文件 ===
-$timestamp = Get-Date -Format "yyyyMMddHHmmss"
-$zipPath = "D:\project\dist-$timestamp.zip"
-
-Write-Host "`n🗜️ 正在压缩 dist..." -ForegroundColor Cyan
-Compress-Archive -Path "$sourceDir\*" -DestinationPath $zipPath -CompressionLevel Optimal
-$zipSizeMB = [math]::Round((Get-Item $zipPath).Length / 1MB, 2)
-
-Write-Host "`n🚀 上传压缩包到服务器 ($zipSizeMB MB)..." -ForegroundColor Cyan
-scp -P $sshPort $zipPath "${remoteUser}@${remoteIP}:~/dist-latest.zip"
-
-# === 生成远程 bash 部署脚本 ===
-$remoteScript = @'
-#!/bin/bash
-set -e
-
-timestamp={0}
-tmpdir="/tmp/dist-temp-$timestamp"
-
-echo "📁 创建临时目录 $tmpdir"
-mkdir -p "$tmpdir"
-
-echo "📦 解压上传文件"
-unzip -qo ~/dist-latest.zip -d "$tmpdir"
-
-echo "🔒 设置 root 权限"
-sudo chown -R root:root "$tmpdir"
-
-if [ -d "{1}" ]; then
-  echo "🕐 备份旧目录"
-  sudo mv "{1}" "{1}-backup-$timestamp"
-fi
-
-echo "🚀 替换新目录"
-sudo mv "$tmpdir" "{1}"
-
-echo "🧹 删除压缩包"
-rm ~/dist-latest.zip
-
-echo "✅ 远程部署完成: {1} 替换成功"
-'@ -f $timestamp, $remotePath
-
-
-# === 写入为 LF 格式(避免 \r 问题)===
-$localScriptPath = "D:\project\deploy-temp.sh"
-$remoteScriptLF = $remoteScript -replace "`r", ""
-Set-Content -Path $localScriptPath -Value $remoteScriptLF -Encoding UTF8
-
-# === 上传并执行远程脚本 ===
-Write-Host "`n📤 上传远程部署脚本..." -ForegroundColor Cyan
-scp -P $sshPort $localScriptPath "${remoteUser}@${remoteIP}:~/deploy-temp.sh"
-
-Write-Host "`n📦 正在服务器上原子部署 ..." -ForegroundColor Cyan
-ssh -p $sshPort ${remoteUser}@${remoteIP} "bash ~/deploy-temp.sh"
-
-# === 清理 ===
-Write-Host "`n🧹 清理临时文件..." -ForegroundColor DarkGray
-ssh -p $sshPort ${remoteUser}@${remoteIP} 'rm ~/deploy-temp.sh'
-Remove-Item $zipPath, $localScriptPath -Force -ErrorAction SilentlyContinue
-
-Write-Host "`n✅ 部署完成,压缩包大小:$zipSizeMB MB" -ForegroundColor Green

+ 0 - 49
merge_dev_to_pro.sh

@@ -1,49 +0,0 @@
-#!/bin/bash
-# 用于将 dev 分支合并到 prod 分支,保留 prod 配置文件版本
-# 支持第一次对齐历史 & 后续增量合并
-# 使用方法:
-#   sh merge_dev_to_pro.sh first    # 第一次合并
-#   sh merge_dev_to_pro.sh          # 以后正常合并
-
-CONFIG_FILES=("Jenkinsfile" "Dockerfile" "nginx.conf")
-
-# 确保脚本在项目根目录运行
-if [ ! -d .git ]; then
-    echo "❌ 请在 Git 项目根目录运行此脚本"
-    exit 1
-fi
-
-# 1. 更新两个分支
-echo "📦 更新本地分支..."
-git checkout prod && git pull origin prod
-git checkout dev && git pull origin dev
-
-# 2. 切回 pro 分支
-git checkout prod
-
-# 3. 第一次合并(建立历史关系)
-if [ "$1" == "first" ]; then
-    echo "🚀 第一次对齐历史,准备合并 dev..."
-    git merge dev --no-commit
-else
-    echo "🔄 增量合并 dev..."
-    git merge dev --no-commit
-fi
-
-# 4. 保留 prod 分支的配置文件
-echo "🛡 保留 prod 配置文件版本..."
-for file in "${CONFIG_FILES[@]}"; do
-    if [ -f "$file" ]; then
-        git checkout --ours "$file"
-        git add "$file"
-        echo "  ✅ 已保留 $file"
-    else
-        echo "  ⚠️ $file 在当前分支不存在,跳过"
-    fi
-done
-
-# 5. 提交合并
-git commit -m "Merge dev into prod (keep prod config files)"
-git push origin prod
-
-echo "✅ 合并完成!"