From abf2facafe656c27a9ecf415c5f34b19ddfbd9bd Mon Sep 17 00:00:00 2001 From: Danilo Pantani Date: Tue, 16 Jul 2024 15:12:03 +0200 Subject: [PATCH] fix cmds --- spaceship/cmd/debug/main.go | 2 +- spaceship/cmd/ssh.go | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/spaceship/cmd/debug/main.go b/spaceship/cmd/debug/main.go index cbe2db2..ff5afc8 100644 --- a/spaceship/cmd/debug/main.go +++ b/spaceship/cmd/debug/main.go @@ -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 diff --git a/spaceship/cmd/ssh.go b/spaceship/cmd/ssh.go index 5673cff..ba303e4 100644 --- a/spaceship/cmd/ssh.go +++ b/spaceship/cmd/ssh.go @@ -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 } @@ -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 }