Skip to content

Commit

Permalink
remove development mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantani committed Jul 16, 2024
1 parent abf2fac commit 9fb0e2a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 63 deletions.
4 changes: 0 additions & 4 deletions spaceship/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 0 additions & 5 deletions spaceship/cmd/debug/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
36 changes: 0 additions & 36 deletions spaceship/cmd/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,6 @@ import (
"github.com/ignite/apps/spaceship/pkg/ssh"
)

func ExecuteSSHDevelopment(ctx context.Context, chain *plugin.ChainInfo) error {
var (
host = "[email protected]" // 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:]
Expand Down
18 changes: 0 additions & 18 deletions spaceship/pkg/ssh/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9fb0e2a

Please sign in to comment.