code: func (s *deployerService) Deploy(ctx context.Context, opts DeployOpts) (*Release, error) {
  	w := opts.Output
  
  	var stream twelvefactor.StatusStream
  	if opts.Stream {
  		stream = w
  	}
  
  	r, err := s.createInTransaction(ctx, stream, opts)
  	if err != nil {
  		return r, w.Error(err)
  	}
  
  	if err := w.Status(fmt.Sprintf("Created new release v%d for %s", r.Version, r.App.Name)); err != nil {
  		return r, err
  	}
  
  	if err := s.releases.Release(ctx, r, stream); err != nil {
  		return r, w.Error(err)
  	}
  
  	return r, w.Status(fmt.Sprintf("Finished processing events for release v%d of %s", r.Version, r.App.Name))
  }
docs: // Deploy is a thin wrapper around deploy to that adds the error to the
  // jsonmessage stream.