feat: 在部署脚本中添加src目录上传功能
This commit is contained in:
@@ -7,6 +7,7 @@ $remoteUser = "cubie"
|
||||
$keyPath = "d:\163"
|
||||
$serverDest = "/home/cubie/down/document/bidding/publish/server"
|
||||
$frontendDest = "/home/cubie/down/document/bidding/publish/"
|
||||
$srcDest = "/home/cubie/down/document/bidding/"
|
||||
|
||||
# Check if key file exists
|
||||
if (-not (Test-Path $keyPath)) {
|
||||
@@ -26,6 +27,12 @@ if (-not (Test-Path "frontend")) {
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check if src directory exists
|
||||
if (-not (Test-Path "src")) {
|
||||
Write-Error "src directory not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Starting deployment..." -ForegroundColor Green
|
||||
Write-Host "Remote server: ${remoteHost}:${remotePort}" -ForegroundColor Cyan
|
||||
Write-Host "Private key: $keyPath" -ForegroundColor Cyan
|
||||
@@ -52,4 +59,15 @@ if ($LASTEXITCODE -ne 0) {
|
||||
|
||||
Write-Host "frontend directory uploaded successfully" -ForegroundColor Green
|
||||
|
||||
# Upload entire src directory to bidding directory
|
||||
Write-Host "`nUploading src directory to ${srcDest}..." -ForegroundColor Yellow
|
||||
scp -i $keyPath -P $remotePort -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -r src "${remoteUser}@${remoteHost}:${srcDest}"
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Failed to upload src directory"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "src directory uploaded successfully" -ForegroundColor Green
|
||||
|
||||
Write-Host "`nDeployment completed!" -ForegroundColor Green
|
||||
|
||||
Reference in New Issue
Block a user