From 9fb0e2a7735779cfa78f7985655af9223445d123 Mon Sep 17 00:00:00 2001 From: Danilo Pantani Date: Tue, 16 Jul 2024 16:12:28 +0200 Subject: [PATCH] remove development mode --- spaceship/cmd/cmd.go | 4 ---- spaceship/cmd/debug/main.go | 5 ----- spaceship/cmd/ssh.go | 36 ------------------------------------ spaceship/pkg/ssh/ssh.go | 18 ------------------ 4 files changed, 63 deletions(-) diff --git a/spaceship/cmd/cmd.go b/spaceship/cmd/cmd.go index 7d8ccf1f..320d20c8 100644 --- a/spaceship/cmd/cmd.go +++ b/spaceship/cmd/cmd.go @@ -13,10 +13,6 @@ func GetCommands() []*plugin.Command { Use: "ssh", Short: "deploy your chain trough ssh", Commands: []*plugin.Command{ - { - Use: "dev", - Short: "deploy your chain into a development mode", - }, { Use: "deploy", Short: "deploy your chain into a production mode", diff --git a/spaceship/cmd/debug/main.go b/spaceship/cmd/debug/main.go index ff5afc85..77fecc97 100644 --- a/spaceship/cmd/debug/main.go +++ b/spaceship/cmd/debug/main.go @@ -33,11 +33,6 @@ func main() { } case "ssh": switch args[2] { - case "dev": - if err := cmd.ExecuteSSHDevelopment(ctx, chainInfo); err != nil { - fmt.Fprintln(os.Stderr, err) - return - } case "deploy": if err := cmd.ExecuteSSHDeploy(ctx, chainInfo); err != nil { fmt.Fprintln(os.Stderr, err) diff --git a/spaceship/cmd/ssh.go b/spaceship/cmd/ssh.go index ba303e4d..618b56fd 100644 --- a/spaceship/cmd/ssh.go +++ b/spaceship/cmd/ssh.go @@ -12,42 +12,6 @@ import ( "github.com/ignite/apps/spaceship/pkg/ssh" ) -func ExecuteSSHDevelopment(ctx context.Context, chain *plugin.ChainInfo) error { - var ( - host = "danilopantani@127.0.0.1" // arg host or URI - key = "/Users/danilopantani/.ssh/id_rsa" // flag key - // user = "danilopantani" // flag user - // password = "" // flag password - // port = "22" // flag port - // keyPassword = args[5] // flag key password - // keyRaw = args[6] // flag key raw - args = []string{"chain", "build"} // arg ignite cmd - ) - - c, err := ssh.New(host, ssh.WithKey(key), ssh.WithWorkspace(chain.ChainId)) - if err != nil { - return err - } - if err := c.Connect(); err != nil { - return err - } - defer c.Close() - - srcPath, err := c.UploadSource(ctx, chain.AppPath) - if err != nil { - return err - } - - args = append(args, "-p", srcPath) - out, err := c.RunIgniteCommand(ctx, args...) - if err != nil { - return err - } - - fmt.Println(out) - return nil -} - // ExecuteSSHDeploy executes the ssh deploy subcommand. func ExecuteSSHDeploy(ctx context.Context, chain *plugin.ChainInfo) error { // args := os.Args[2:] diff --git a/spaceship/pkg/ssh/ssh.go b/spaceship/pkg/ssh/ssh.go index 369474cb..6543d822 100644 --- a/spaceship/pkg/ssh/ssh.go +++ b/spaceship/pkg/ssh/ssh.go @@ -152,10 +152,6 @@ func (s *SSH) Home() string { return filepath.Join(s.Workspace(), "home") } -func (s *SSH) Source() string { - return filepath.Join(s.Workspace(), "source") -} - func (s *SSH) Ignite() string { return filepath.Join(s.Bin(), igniteAppName) } @@ -227,15 +223,6 @@ func (s *SSH) ensureEnvironment() error { if err := s.sftpClient.MkdirAll(s.Home()); err != nil { return errors.Wrapf(err, "failed to create dir %s", s.Bin()) } - if err := s.sftpClient.MkdirAll(s.Source()); err != nil { - return errors.Wrapf(err, "failed to create dir %s", s.Bin()) - } - if err := s.ensureLocalBin(igniteAppName); err != nil { - return errors.Wrapf(err, "failed to add ignite binary") - } - if err := s.ensureLocalBin(goAppName); err != nil { - return errors.Wrapf(err, "failed to add go binary") - } return nil } @@ -315,11 +302,6 @@ func (s *SSH) UploadBinary(srcPath string) (string, error) { return binPath, nil } -func (s *SSH) UploadSource(ctx context.Context, srcPath string) (string, error) { - path := s.Source() - return path, s.Upload(ctx, srcPath, path) -} - func (s *SSH) UploadHome(ctx context.Context, srcPath string) (string, error) { path := s.Home() return path, s.Upload(ctx, srcPath, path)