Skip to content

Commit

Permalink
catch errors in cli deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrildiagne committed Jan 14, 2020
1 parent 5b96044 commit a6f3575
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions cmd/cli/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ var deployCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
published, _ := cmd.Flags().GetString("from")
if published != "" {
deployFromPublished(published)
if err := deployFromPublished(published); err != nil {
panic(err)
}
} else {
deployFromLocal()
if err := deployFromLocal(); err != nil {
panic(err)
}
}
},
}
Expand Down Expand Up @@ -56,18 +60,19 @@ func deployFromPublished(published string) error {
return nil
}

func deployFromLocal() {
func deployFromLocal() error {
// Load the manifest
manifestFile := "./kuda.yaml"
manifest, err := utils.LoadManifest(manifestFile)
if err != nil {
fmt.Println("Could not load manifest", manifestFile)
panic(err)
return err
}

if err := deploy(manifest); err != nil {
fmt.Println("ERROR:", err)
return err
}
return nil
}

func addContextFilesToRequest(source string, writer *multipart.Writer) error {
Expand Down

0 comments on commit a6f3575

Please sign in to comment.