fix: register-node needs job:register arg, add --deploy flag for .env mode

This commit is contained in:
admin 2026-08-01 19:24:10 +00:00
parent e9dff30d84
commit b01f5d6a52
2 changed files with 18 additions and 0 deletions

View file

@ -303,6 +303,7 @@ deployment. On subsequent runs, it shows your existing deployments.
help := flag.Bool("help", false, "Show help")
versionFlag := flag.Bool("version", false, "Show version")
tunnelFlag := flag.Bool("tunnel", false, "Start reverse SSH tunnel")
deployFlag := flag.Bool("deploy", false, "Deploy directly from /opt/fw/.env (skip TUI)")
flag.Parse()
if *help {
@ -330,6 +331,22 @@ deployment. On subsequent runs, it shows your existing deployments.
return
}
if *deployFlag {
result := preflight.Run()
for _, c := range result.Checks {
marker := "✅"
if !c.Passed { marker = "❌" } else if c.Warning { marker = "⚠️" }
fmt.Printf(" %s %s — %s\n", marker, c.Name, c.Detail)
}
if !result.Passed {
fmt.Println("\n❌ Preflight checks failed.")
os.Exit(1)
}
fmt.Println("✅ Preflight checks passed.\n")
runDeployFlow(result)
return
}
// ── Default: preflight → TUI wizard/dashboard ────────────────
fmt.Println("═══ Wallarm Deployment Manager ═══")
fmt.Printf(" version %s\n", version)

View file

@ -84,6 +84,7 @@ func InstallNode(node state.Node, apiToken, apiHost, labels string) error {
fmt.Printf("[%s] Registering node...\n", node.Name)
registerCmd := exec.Command(filepath.Join(DeployTo, "register-node"),
"job:register",
"-token", apiToken,
"-host", apiHost,
)