diff --git a/scripts/deploy-from-workstation.ps1 b/scripts/deploy-from-workstation.ps1 index e8122b54..5699b6df 100644 --- a/scripts/deploy-from-workstation.ps1 +++ b/scripts/deploy-from-workstation.ps1 @@ -30,6 +30,7 @@ $repoRoot = (Resolve-Path (Join-Path $scriptRoot '..')).Path . (Join-Path $scriptRoot 'deploy-auth.ps1') $authSession = $null $sshOptions = @() +$scpOptions = if ($IsMacOS) { @('-O') } else { @() } $sshTarget = "${SshUser}@${Server}" $imageName = 'caiwu_akaunting' $targetPlatform = 'linux/amd64' @@ -434,7 +435,7 @@ try { if ($BootstrapServer) { $bootstrapRemote = "/tmp/caiwu-bootstrap-$imageTag.sh" Invoke-Native { - scp @sshOptions deploy/bootstrap-server.sh "${sshTarget}:$bootstrapRemote" + scp @scpOptions @sshOptions deploy/bootstrap-server.sh "${sshTarget}:$bootstrapRemote" } '上传服务器初始化脚本失败。' Invoke-Native { ssh @sshOptions $sshTarget "chmod 700 '$bootstrapRemote' && '$bootstrapRemote' '$AppUrl' '$RemotePath' && rm -f '$bootstrapRemote'" @@ -449,7 +450,7 @@ try { $migrationFlag = if ($AllowMigrations) { '1' } else { '0' } Invoke-Native { - scp @sshOptions ` + scp @scpOptions @sshOptions ` compose.jiangling.yml ` deploy/activate-release.sh ` deploy/activate-incremental-release.sh ` @@ -483,7 +484,7 @@ try { Remove-Item -LiteralPath $localTar -Force $archiveSizeMB = [math]::Round((Get-Item -LiteralPath $localArchive).Length / 1MB, 1) Write-Host "首次初始化全量包:$archiveSizeMB MiB" - Invoke-Native { scp @sshOptions $localArchive "${sshTarget}:$remoteArchive" } '上传镜像失败。' + Invoke-Native { scp @scpOptions @sshOptions $localArchive "${sshTarget}:$remoteArchive" } '上传镜像失败。' Invoke-Native { ssh @sshOptions $sshTarget "chmod 700 '$RemotePath/'*.sh && chmod 644 '$RemotePath/config-db-init.sh' && '$RemotePath/activate-release.sh' '$remoteArchive' '$imageTag' '$RemotePath' '$deploySha' '$migrationFlag' '$KeepImages' && '$RemotePath/setup-incremental-registry.sh' '$RemotePath' '$RemotePath/registry-config.yml'" } '服务器激活、健康检查或增量仓库初始化失败。'