From f17a10fa1490e4a1840997900770a43ce2ac7313 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期三, 09 四月 2025 17:01:45 +0800 Subject: [PATCH] 资源占用中,请检查后再试~ --- deploy/deploy.config.js | 54 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 44 insertions(+), 10 deletions(-) diff --git a/deploy/deploy.config.js b/deploy/deploy.config.js index a050593..ce12396 100644 --- a/deploy/deploy.config.js +++ b/deploy/deploy.config.js @@ -1,4 +1,15 @@ -const deployJson = require('../customer_list/ch/deploy.json'); + +const testWebDir = 'E:/Wi/web/test'; +// 蹇界暐鍚屾鐨勭洰褰� +const ignoreProj = ['prod']; +// 鍚屾鏃堕渶瑕佷繚鐣欑殑鏂囦欢璺緞锛堢浉瀵硅矾寰勶級 +const ignoreSyncPath = ['static/config/globalConfig.js']; +// 閮ㄧ讲鍚庡悓姝ユ枃浠跺埌鍚屽眰鍏朵粬椤圭洰鐩綍锛屼笖蹇界暐椤圭洰閰嶇疆鏂囦欢 +const remoteRunAfter = `cd /d ${testWebDir} && powershell -Command "$currentDir = Split-Path -Leaf (Get-Location); $ignoreDirs = @('${ignoreProj.join( + "','" +)}', $currentDir); $ignoreSyncPaths = @('${ignoreSyncPath.join( + "','" +)}'); $parentDir = Split-Path (Get-Location) -Parent; Get-ChildItem $parentDir -Directory | Where-Object { -not $ignoreDirs.Contains($_.Name) } | ForEach-Object { $targetDir = $_.FullName; $backupFiles = @{}; foreach ($ignorePath in $ignoreSyncPaths) { $fullIgnorePath = Join-Path $targetDir $ignorePath; if (Test-Path $fullIgnorePath) { $tempPath = Join-Path $env:TEMP ('backup_' + [guid]::NewGuid().ToString()); Copy-Item -Path $fullIgnorePath -Destination $tempPath -Force; $backupFiles[$ignorePath] = $tempPath; } }; Get-ChildItem $targetDir -Recurse | Where-Object { $_.FullName -ne $targetDir } | Remove-Item -Force -Recurse; Get-ChildItem -Path '.' -Recurse -File | Where-Object { $relativePath = $_.FullName.Substring((Get-Location).Path.Length + 1); $shouldCopy = $true; foreach ($ignorePath in $ignoreSyncPaths) { if ($relativePath -like $ignorePath) { $shouldCopy = $false; break; } }; $shouldCopy } | ForEach-Object { $relativePath = $_.FullName.Substring((Get-Location).Path.Length + 1); $targetPath = Join-Path $targetDir $relativePath; $targetParent = Split-Path $targetPath -Parent; if (-not (Test-Path $targetParent)) { New-Item -Path $targetParent -ItemType Directory -Force | Out-Null }; Copy-Item -Path $_.FullName -Destination $targetPath -Force }; foreach ($ignorePath in $ignoreSyncPaths) { if ($backupFiles.ContainsKey($ignorePath)) { $fullIgnorePath = Join-Path $targetDir $ignorePath; $parentFolder = Split-Path $fullIgnorePath -Parent; if (-not (Test-Path $parentFolder)) { New-Item -Path $parentFolder -ItemType Directory -Force | Out-Null }; Move-Item -Path $backupFiles[$ignorePath] -Destination $fullIgnorePath -Force } } }"`; module.exports = { privateKeyPath: 'C:/ssh/id_rsa', // 鏈湴绉侀挜鍦板潃锛屼綅缃竴鑸湪C:/Users/xxx/.ssh/id_rsa锛岄潪蹇呭~锛屾湁绉侀挜鍒欓厤缃� passphrase: '', // 鏈湴绉侀挜瀵嗙爜锛岄潪蹇呭~锛屾湁绉侀挜鍒欓厤缃� @@ -8,16 +19,31 @@ // 娴嬭瘯鐜 name: '娴嬭瘯鐜', preRun: '', // 娴嬭瘯鐜鎵撳寘鑴氭湰 - host: deployJson.test.host, // 娴嬭瘯鏈嶅姟鍣ㄥ湴鍧� + host: '47.100.245.85', // 娴嬭瘯鏈嶅姟鍣ㄥ湴鍧� port: 22, // ssh port锛屼竴鑸粯璁�22 - username: deployJson.test.username, // 鐧诲綍鏈嶅姟鍣ㄧ敤鎴峰悕 + username: 'Administrator', // 鐧诲綍鏈嶅姟鍣ㄧ敤鎴峰悕 password: '', // 鐧诲綍鏈嶅姟鍣ㄥ瘑鐮� distPath: 'dist', // 鏈湴鎵撳寘dist鐩綍 - webDir: deployJson.test.path.slice(1), // // 娴嬭瘯鐜鏈嶅姟鍣ㄥ湴鍧� - bakOld: true, // 鏄惁澶囦唤鏃х殑锛屼繚鐣欎笂涓�浠芥棫鐨� + webDir: testWebDir, // // 娴嬭瘯鐜鏈嶅姟鍣ㄥ湴鍧� + + remoteIgnorePath: 'WI姘村姟鏅鸿兘鍔╂墜.apk', // 杩滅▼鏈嶅姟鍣ㄥ拷鐣ュ垹闄ゆ枃浠舵垨鏂囦欢澶癸紝鍙~鏁扮粍鎴栧瓧绗︿覆 + // 澶囦唤 + bakOld: { + // 澶囦唤涓暟锛屼笉濉粯璁� 3 涓� + num: 3, + // 鏄惁澶囦唤锛岄粯璁ゅ惎鐢ㄥ浠� + enable: true, + }, + // 杩滅▼鎵ц鍛戒护 + remoteRun: { + // 閮ㄧ讲鍓嶆墽琛屽懡浠� + before: '', + // 閮ㄧ讲鍚庢墽琛屽懡浠� + after: remoteRunAfter, + }, // 閮ㄧ讲棰勮 preview: { - url: 'http://101.133.133.173:8084/', // 閮ㄧ讲鍚庢鏌ラ儴缃叉晥鏋滐紝鏌ョ湅鐨勭綉椤靛湴鍧� + url: 'https://wi.beng35.com/web/test', // 閮ㄧ讲鍚庢鏌ラ儴缃叉晥鏋滐紝鏌ョ湅鐨勭綉椤靛湴鍧� openInBrowser: false, // 閮ㄧ讲瀹屾垚鍚庢槸鍚﹁嚜鍔ㄦ墦寮�閮ㄧ讲鐨勭綉椤靛湴鍧� }, }, @@ -25,14 +51,22 @@ // 绾夸笂鐜 name: '绾夸笂鐜', preRun: '', // 绾夸笂鐜鎵撳寘鑴氭湰 - host: deployJson.product.host, // 娴嬭瘯鏈嶅姟鍣ㄥ湴鍧� + host: '47.100.245.85', // 绾夸笂鏈嶅姟鍣ㄥ湴鍧� port: 22, // ssh port锛屼竴鑸粯璁�22 - username: deployJson.product.username, // 鐧诲綍鏈嶅姟鍣ㄧ敤鎴峰悕 + username: 'administrator', // 鐧诲綍鏈嶅姟鍣ㄧ敤鎴峰悕 password: '', // 鐧诲綍鏈嶅姟鍣ㄥ瘑鐮� distPath: 'dist', // 鏈湴鎵撳寘dist鐩綍 - webDir: deployJson.product.path.slice(1), // 娴嬭瘯鐜鏈嶅姟鍣ㄥ湴鍧� + webDir: 'E:/Wi/web/prod', // 绾夸笂鐜鏈嶅姟鍣ㄥ湴鍧� + remoteIgnorePath: 'WI姘村姟鏅鸿兘鍔╂墜.apk', // 杩滅▼鏈嶅姟鍣ㄥ拷鐣ュ垹闄ゆ枃浠舵垨鏂囦欢澶癸紝鍙~鏁扮粍鎴栧瓧绗︿覆 + // 澶囦唤 + bakOld: { + // 澶囦唤涓暟锛屼笉濉粯璁� 3 涓� + num: 3, + // 鏄惁澶囦唤锛岄粯璁ゅ惎鐢ㄥ浠� + enable: true, + }, preview: { - url: 'https://https://wi.beng35.com/', + url: 'https://wi.beng35.com/', openInBrowser: false, }, }, -- Gitblit v1.9.3