diff options
| author | Clawd <ai@clawd.bot> | 2026-02-15 18:52:55 -0800 |
|---|---|---|
| committer | Clawd <ai@clawd.bot> | 2026-02-15 18:52:55 -0800 |
| commit | a7436dfcc01a599bbb99a810bd59e92b21252c78 (patch) | |
| tree | a6b25806acf15bd334629c72788d035c140b030e /cmd/ship/root_v2.go | |
| parent | 146393527c20df3717711eced83fb9f58f96c884 (diff) | |
feat(v2): implement ship host init with JSON output
- host_v2.go: full host initialization with JSON responses
- Installs Caddy, Docker on Ubuntu/Debian
- Creates /etc/ship/{env,ports,ttl} directories
- Installs TTL cleanup timer (hourly systemd timer)
- Cleanup script removes expired deploys completely
- Preserves git deploy setup functionality (optional)
- Added ErrInvalidArgs error code
Critical 'host init' functionality preserved for v2
Diffstat (limited to 'cmd/ship/root_v2.go')
| -rw-r--r-- | cmd/ship/root_v2.go | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/cmd/ship/root_v2.go b/cmd/ship/root_v2.go index dab63be..9900e83 100644 --- a/cmd/ship/root_v2.go +++ b/cmd/ship/root_v2.go | |||
| @@ -52,6 +52,9 @@ func initV2() { | |||
| 52 | rootV2Cmd.AddCommand(logsV2Cmd) | 52 | rootV2Cmd.AddCommand(logsV2Cmd) |
| 53 | rootV2Cmd.AddCommand(removeV2Cmd) | 53 | rootV2Cmd.AddCommand(removeV2Cmd) |
| 54 | rootV2Cmd.AddCommand(hostV2Cmd) | 54 | rootV2Cmd.AddCommand(hostV2Cmd) |
| 55 | |||
| 56 | // Initialize host subcommands (from host_v2.go) | ||
| 57 | initHostV2() | ||
| 55 | } | 58 | } |
| 56 | 59 | ||
| 57 | func runDeployV2(cmd *cobra.Command, args []string) error { | 60 | func runDeployV2(cmd *cobra.Command, args []string) error { |
| @@ -132,27 +135,4 @@ var hostV2Cmd = &cobra.Command{ | |||
| 132 | Short: "Manage VPS host", | 135 | Short: "Manage VPS host", |
| 133 | } | 136 | } |
| 134 | 137 | ||
| 135 | func init() { | 138 | // hostInitV2Cmd, hostStatusV2Cmd, and initHostV2() are defined in host_v2.go |
| 136 | hostV2Cmd.AddCommand(hostInitV2Cmd) | ||
| 137 | hostV2Cmd.AddCommand(hostStatusV2Cmd) | ||
| 138 | } | ||
| 139 | |||
| 140 | var hostInitV2Cmd = &cobra.Command{ | ||
| 141 | Use: "init USER@HOST --domain DOMAIN", | ||
| 142 | Short: "Initialize a VPS for deployments", | ||
| 143 | RunE: func(cmd *cobra.Command, args []string) error { | ||
| 144 | // TODO: implement - this is critical functionality to preserve | ||
| 145 | output.PrintAndExit(output.Err(output.ErrNotFound, "not implemented")) | ||
| 146 | return nil | ||
| 147 | }, | ||
| 148 | } | ||
| 149 | |||
| 150 | var hostStatusV2Cmd = &cobra.Command{ | ||
| 151 | Use: "status", | ||
| 152 | Short: "Check host status", | ||
| 153 | RunE: func(cmd *cobra.Command, args []string) error { | ||
| 154 | // TODO: implement | ||
| 155 | output.PrintAndExit(output.Err(output.ErrNotFound, "not implemented")) | ||
| 156 | return nil | ||
| 157 | }, | ||
| 158 | } | ||
