

try {
    $ErrorActionPreference = "Stop"

    Write-Host "1. Uploading binary exec..." -ForegroundColor Green
    ssh root@192.168.35.71 "mkdir -p /root/wdd/ranjing-python-devfusion/"
    scp C:\Users\wdd\IdeaProjects\ProjectOctopus\agent-common\SplitProject\ranjing-python-devfusion\* root@192.168.35.71:/root/wdd/ranjing-python-devfusion/

    Write-Host "2. Exec the command ..." -ForegroundColor Blue
    Write-Host ""
    Write-Host ""
    ssh root@192.168.35.71 "cd /root/wdd/ranjing-python-devfusion/ && docker build -t ranjing/dev-fusion:v1.0 ."
    Write-Host ""
    Write-Host ""
} catch {
    Write-Host "操作失败: $_" -ForegroundColor Red
    exit 1
}