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 | 22 ++++++++++++++++++++-- 1 files changed, 20 insertions(+), 2 deletions(-) diff --git a/deploy/deploy.config.js b/deploy/deploy.config.js index ecf697f..ce12396 100644 --- a/deploy/deploy.config.js +++ b/deploy/deploy.config.js @@ -1,3 +1,15 @@ + +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: '', // 鏈湴绉侀挜瀵嗙爜锛岄潪蹇呭~锛屾湁绉侀挜鍒欓厤缃� @@ -12,8 +24,7 @@ username: 'Administrator', // 鐧诲綍鏈嶅姟鍣ㄧ敤鎴峰悕 password: '', // 鐧诲綍鏈嶅姟鍣ㄥ瘑鐮� distPath: 'dist', // 鏈湴鎵撳寘dist鐩綍 - webDir: 'E:/Wi/web/test', // // 娴嬭瘯鐜鏈嶅姟鍣ㄥ湴鍧� - // webDir: 'E:/Wi/web/guangming', // // 娴嬭瘯鐜鏈嶅姟鍣ㄥ湴鍧� + webDir: testWebDir, // // 娴嬭瘯鐜鏈嶅姟鍣ㄥ湴鍧� remoteIgnorePath: 'WI姘村姟鏅鸿兘鍔╂墜.apk', // 杩滅▼鏈嶅姟鍣ㄥ拷鐣ュ垹闄ゆ枃浠舵垨鏂囦欢澶癸紝鍙~鏁扮粍鎴栧瓧绗︿覆 // 澶囦唤 @@ -23,6 +34,13 @@ // 鏄惁澶囦唤锛岄粯璁ゅ惎鐢ㄥ浠� enable: true, }, + // 杩滅▼鎵ц鍛戒护 + remoteRun: { + // 閮ㄧ讲鍓嶆墽琛屽懡浠� + before: '', + // 閮ㄧ讲鍚庢墽琛屽懡浠� + after: remoteRunAfter, + }, // 閮ㄧ讲棰勮 preview: { url: 'https://wi.beng35.com/web/test', // 閮ㄧ讲鍚庢鏌ラ儴缃叉晥鏋滐紝鏌ョ湅鐨勭綉椤靛湴鍧� -- Gitblit v1.9.3