[agent-wdd] 基本完成Info部分的整理
This commit is contained in:
28
agent-wdd/one-build-and-run.ps1
Normal file
28
agent-wdd/one-build-and-run.ps1
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
try {
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Write-Host "1. Building binary exec file..." -ForegroundColor Cyan
|
||||
& "C:\Users\wdd\go\bin\gox.exe" -osarch="linux/amd64" -output "build/agent-wdd_{{.OS}}_{{.Arch}}"
|
||||
|
||||
# 执行远程ssh命令 ssh root@192.168.35.71 "rm /root/agent-wdd_linux_amd64"
|
||||
Write-Host "2. Cleaning old binary file..." -ForegroundColor Yellow
|
||||
ssh root@192.168.35.71 "rm -f /root/agent-wdd_linux_amd64 && rm /usr/local/etc/wdd/agent-wdd-config.yaml"
|
||||
|
||||
Write-Host "3. Uploading binary exec..." -ForegroundColor Green
|
||||
scp build/agent-wdd_linux_amd64 root@192.168.35.71:/root/
|
||||
|
||||
Write-Host "4. Exec the command ..." -ForegroundColor Blue
|
||||
Write-Host ""
|
||||
Write-Host ""
|
||||
ssh root@192.168.35.71 "chmod +x agent-wdd_linux_amd64 && ./agent-wdd_linux_amd64 info os"
|
||||
Write-Host ""
|
||||
Write-Host ""
|
||||
Write-Host "5. Cheak Info Result ..." -ForegroundColor Blue
|
||||
ssh root@192.168.35.71 "cat /usr/local/etc/wdd/agent-wdd-config.yaml"
|
||||
|
||||
} catch {
|
||||
Write-Host "操作失败: $_" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
Reference in New Issue
Block a user