func runDeploy(cmd *Command, args []string) { r, w := io.Pipe() if len(args) < 1 { printFatal("You must specify an image to deploy") } image := args[0] form := &PostDeployForm{Image: image} var endpoint string appName, _ := app() if appName != "" { endpoint = fmt.Sprintf("/apps/%s/deploys", appName) } else { endpoint = "/deploys" } go func() { must(client.Post(w, endpoint, form)) must(w.Close()) }() outFd, isTerminalOut := term.GetFdInfo(os.Stdout) must(jsonmessage.DisplayJSONMessagesStream(r, os.Stdout, outFd, isTerminalOut)) }
func runDeploy(cmd *Command, args []string) { r, w := io.Pipe() if len(args) < 1 { printFatal("You must specify an image to deploy") } image := args[0] form := &PostDeployForm{Image: image} go func() { must(client.Post(w, "/deploys", form)) must(w.Close()) }() outFd, isTerminalOut := term.GetFdInfo(os.Stdout) must(jsonmessage.DisplayJSONMessagesStream(r, os.Stdout, outFd, isTerminalOut)) }