Skip to content

Commit

Permalink
fix cmds
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantani committed Jul 16, 2024
1 parent 4ad1613 commit abf2fac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion spaceship/cmd/debug/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func main() {
fmt.Fprintln(os.Stderr, err)
return
}
case "prod":
case "deploy":
if err := cmd.ExecuteSSHDeploy(ctx, chainInfo); err != nil {
fmt.Fprintln(os.Stderr, err)
return
Expand Down
13 changes: 9 additions & 4 deletions spaceship/cmd/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@ func ExecuteSSHDeploy(ctx context.Context, chain *plugin.ChainInfo) error {

// we are using the ignite chain build command to build the app.
igniteChainBuildCmd := ignitecmd.NewChainBuild()
igniteChainBuildCmd.SetArgs([]string{"-p", chain.AppPath, "-o", binOutput, "-y"})
igniteChainBuildCmd.SetArgs([]string{"-p", chain.AppPath, "-o", binOutput})
if err := igniteChainBuildCmd.ExecuteContext(ctx); err != nil {
return err
}

// init the chain
igniteChainInitCmd := ignitecmd.NewChainInit()
igniteChainInitCmd.SetArgs([]string{"-p", chain.AppPath, "-h", chainHome, "-y"})
igniteChainInitCmd.SetArgs([]string{"-p", chain.AppPath, "-h", chainHome})
if err := igniteChainInitCmd.ExecuteContext(ctx); err != nil {
return err
}

c, err := ssh.New(host, ssh.WithKey(key))
c, err := ssh.New(host, ssh.WithKey(key), ssh.WithWorkspace(chain.ChainId))
if err != nil {
return err
}
Expand All @@ -93,7 +93,12 @@ func ExecuteSSHDeploy(ctx context.Context, chain *plugin.ChainInfo) error {
if err != nil {
return err
}

fmt.Println(binPath)

homePath, err := c.UploadHome(ctx, chainHome)
if err != nil {
return err
}
fmt.Println(homePath)
return nil
}

0 comments on commit abf2fac

Please sign in to comment.