Skip to content

Commit

Permalink
all: remove cloud subcommand and unused packages (#2438)
Browse files Browse the repository at this point in the history
Some cleanup that removes `devbox cloud` along with other packages that
aren't used anymore.
  • Loading branch information
gcurtis authored Dec 5, 2024
1 parent bea590f commit abd46b7
Show file tree
Hide file tree
Showing 52 changed files with 2 additions and 4,540 deletions.
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ require (
github.com/aws/aws-sdk-go-v2/service/sts v1.28.11
github.com/bmatcuk/doublestar/v4 v4.6.1
github.com/briandowns/spinner v1.23.0
github.com/cavaliergopher/grab/v3 v3.0.1
github.com/cloudflare/ahocorasick v0.0.0-20210425175752-730270c3e184
github.com/denisbrodbeck/machineid v1.0.1
github.com/f1bonacc1/process-compose v1.6.1
github.com/fatih/color v1.17.0
Expand Down Expand Up @@ -48,7 +46,6 @@ require (
golang.org/x/oauth2 v0.21.0
golang.org/x/sync v0.7.0
golang.org/x/tools v0.22.0
gopkg.in/natefinch/lumberjack.v2 v2.2.1
gopkg.in/yaml.v3 v3.0.1
)

Expand Down Expand Up @@ -78,6 +75,7 @@ require (
github.com/bodgit/sevenzip v1.5.1 // indirect
github.com/bodgit/windows v1.0.1 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/cavaliergopher/grab/v3 v3.0.1 // indirect
github.com/charmbracelet/lipgloss v0.11.0 // indirect
github.com/charmbracelet/x/ansi v0.1.2 // indirect
github.com/cloudflare/circl v1.3.8 // indirect
Expand Down
4 changes: 0 additions & 4 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

176 changes: 0 additions & 176 deletions internal/boxcli/cloud.go

This file was deleted.

24 changes: 0 additions & 24 deletions internal/boxcli/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/spf13/cobra"

"go.jetpack.io/devbox/internal/boxcli/usererr"
"go.jetpack.io/devbox/internal/cloud"
"go.jetpack.io/devbox/internal/devbox"
"go.jetpack.io/devbox/internal/devbox/devopt"
"go.jetpack.io/devbox/internal/devbox/docgen"
Expand All @@ -24,7 +23,6 @@ type generateCmdFlags struct {
config configFlags
force bool
printEnvrcContent bool
githubUsername string
rootUser bool
}

Expand Down Expand Up @@ -61,7 +59,6 @@ func generateCmd() *cobra.Command {
command.AddCommand(debugCmd())
command.AddCommand(direnvCmd())
command.AddCommand(genReadmeCmd())
command.AddCommand(sshConfigCmd())
flags.config.register(command)

return command
Expand Down Expand Up @@ -158,27 +155,6 @@ func direnvCmd() *cobra.Command {
return command
}

func sshConfigCmd() *cobra.Command {
flags := &generateCmdFlags{}
command := &cobra.Command{
Use: "ssh-config",
Hidden: true,
Short: "Generate ssh config to connect to devbox cloud",
Long: "Check ssh config and if they don't exist, it generates the configs necessary to connect to devbox cloud VMs.",
Args: cobra.MaximumNArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
// ssh-config command is exception and it should run without a config file present
_, err := cloud.SSHSetup(flags.githubUsername)
return errors.WithStack(err)
},
}
command.Flags().StringVarP(
&flags.githubUsername, "username", "u", "", "GitHub username to use for ssh",
)
flags.config.register(command)
return command
}

func genReadmeCmd() *cobra.Command {
flags := &GenerateReadmeCmdFlags{}

Expand Down
7 changes: 0 additions & 7 deletions internal/boxcli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (

"go.jetpack.io/devbox/internal/boxcli/featureflag"
"go.jetpack.io/devbox/internal/boxcli/midcobra"
"go.jetpack.io/devbox/internal/cloud/openssh/sshshim"
"go.jetpack.io/devbox/internal/cmdutil"
"go.jetpack.io/devbox/internal/debug"
"go.jetpack.io/devbox/internal/telemetry"
Expand Down Expand Up @@ -82,8 +81,6 @@ func RootCmd() *cobra.Command {
}))
command.AddCommand(updateCmd())
command.AddCommand(versionCmd())
// Preview commands
command.AddCommand(cloudCmd())
// Internal commands
command.AddCommand(genDocsCmd())

Expand Down Expand Up @@ -120,10 +117,6 @@ func Main() {
timer := debug.Timer(strings.Join(os.Args, " "))
setSystemBinaryPaths()
ctx := context.Background()
if strings.HasSuffix(os.Args[0], "ssh") ||
strings.HasSuffix(os.Args[0], "scp") {
os.Exit(sshshim.Execute(ctx, os.Args))
}

if len(os.Args) > 1 && os.Args[1] == "upload-telemetry" {
// This subcommand is hidden and only run by devbox itself as a
Expand Down
Loading

0 comments on commit abd46b7

Please sign in to comment.