Files
mcdeploy/status.go
Kyle Isom 8cd32cbb1c Initial implementation of mcdeploy deployment tool
Single Go binary with five commands:
- build: podman build locally with registry tags + git version
- push: podman push to MCR
- deploy: SSH pull/stop/rm/run on target node
- cert renew: issue TLS cert from Metacrypt via REST API
- status: show container status on a node

Config-driven via TOML service registry describing images,
Dockerfiles, container configs per node. Shells out to podman
for container operations and ssh for remote access.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 00:01:15 -07:00

35 lines
673 B
Go

package main
import (
"fmt"
"github.com/spf13/cobra"
)
func statusCommand() *cobra.Command {
return &cobra.Command{
Use: "status <node>",
Short: "Show container status on a node",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
cfg, err := loadCfg()
if err != nil {
return err
}
node, err := cfg.FindNode(args[0])
if err != nil {
return err
}
host := node.Host
if node.User != "" {
host = node.User + "@" + node.Host
}
fmt.Printf("Containers on %s (%s):\n\n", args[0], node.Host)
return sshRun(host, "podman ps --format 'table {{.Names}}\t{{.Status}}\t{{.Image}}'")
},
}
}