diff --git a/cmd/deploy/main.go b/cmd/deploy/main.go index 284b2cf..95d2145 100644 --- a/cmd/deploy/main.go +++ b/cmd/deploy/main.go @@ -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) diff --git a/internal/native/native.go b/internal/native/native.go index 484fa66..7e8591c 100644 --- a/internal/native/native.go +++ b/internal/native/native.go @@ -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, )