summaryrefslogtreecommitdiffstats
path: root/cmd/deploy/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/deploy/main.go')
-rw-r--r--cmd/deploy/main.go65
1 files changed, 0 insertions, 65 deletions
diff --git a/cmd/deploy/main.go b/cmd/deploy/main.go
deleted file mode 100644
index ad61523..0000000
--- a/cmd/deploy/main.go
+++ /dev/null
@@ -1,65 +0,0 @@
1package main
2
3import (
4 "os"
5
6 "github.com/bdw/deploy/cmd/deploy/env"
7 "github.com/bdw/deploy/cmd/deploy/host"
8 "github.com/spf13/cobra"
9)
10
11var (
12 // Persistent flags
13 hostFlag string
14
15 // Version info (set via ldflags)
16 version = "dev"
17 commit = "none"
18 date = "unknown"
19)
20
21var rootCmd = &cobra.Command{
22 Use: "deploy",
23 Short: "Deploy Go apps and static sites to a VPS with automatic HTTPS",
24 Long: `deploy - Deploy Go apps and static sites to a VPS with automatic HTTPS
25
26A CLI tool for deploying applications and static sites to a VPS.
27Uses Caddy for automatic HTTPS and systemd for service management.`,
28 RunE: runDeploy,
29 SilenceUsage: true,
30 SilenceErrors: true,
31}
32
33func init() {
34 // Persistent flags available to all subcommands
35 rootCmd.PersistentFlags().StringVar(&hostFlag, "host", "", "VPS host (SSH config alias or user@host)")
36
37 // Root command (deploy) flags
38 rootCmd.Flags().String("binary", "", "Path to Go binary (for app deployment)")
39 rootCmd.Flags().Bool("static", false, "Deploy as static site")
40 rootCmd.Flags().String("dir", ".", "Directory to deploy (for static sites)")
41 rootCmd.Flags().String("domain", "", "Domain name (required)")
42 rootCmd.Flags().String("name", "", "App name (default: inferred from binary or directory)")
43 rootCmd.Flags().Int("port", 0, "Port override (default: auto-allocate)")
44 rootCmd.Flags().StringArray("env", nil, "Environment variable (KEY=VALUE, can be specified multiple times)")
45 rootCmd.Flags().String("env-file", "", "Path to .env file")
46 rootCmd.Flags().String("args", "", "Arguments to pass to binary")
47 rootCmd.Flags().StringArray("file", nil, "Config file to upload to working directory (can be specified multiple times)")
48
49 // Add subcommands
50 rootCmd.AddCommand(listCmd)
51 rootCmd.AddCommand(logsCmd)
52 rootCmd.AddCommand(statusCmd)
53 rootCmd.AddCommand(restartCmd)
54 rootCmd.AddCommand(removeCmd)
55 rootCmd.AddCommand(env.Cmd)
56 rootCmd.AddCommand(host.Cmd)
57 rootCmd.AddCommand(uiCmd)
58 rootCmd.AddCommand(versionCmd)
59}
60
61func main() {
62 if err := rootCmd.Execute(); err != nil {
63 os.Exit(1)
64 }
65}