(event v7pushaction.Event, appName string)
| 683 | } |
| 684 | |
| 685 | func (cmd *PushCommand) processEvent(event v7pushaction.Event, appName string) error { |
| 686 | switch event { |
| 687 | case v7pushaction.CreatingArchive: |
| 688 | cmd.UI.DisplayText("Packaging files to upload...") |
| 689 | case v7pushaction.UploadingApplicationWithArchive: |
| 690 | cmd.UI.DisplayText("Uploading files...") |
| 691 | log.Debug("starting progress bar") |
| 692 | cmd.ProgressBar.Ready() |
| 693 | case v7pushaction.UploadingApplication: |
| 694 | cmd.UI.DisplayText("All files found in remote cache; nothing to upload.") |
| 695 | cmd.UI.DisplayText("Waiting for API to complete processing files...") |
| 696 | case v7pushaction.RetryUpload: |
| 697 | cmd.UI.DisplayText("Retrying upload due to an error...") |
| 698 | case v7pushaction.UploadWithArchiveComplete: |
| 699 | cmd.ProgressBar.Complete() |
| 700 | cmd.UI.DisplayNewline() |
| 701 | cmd.UI.DisplayText("Waiting for API to complete processing files...") |
| 702 | case v7pushaction.UploadingDroplet: |
| 703 | cmd.UI.DisplayText("Uploading droplet bits...") |
| 704 | cmd.ProgressBar.Ready() |
| 705 | case v7pushaction.UploadDropletComplete: |
| 706 | cmd.ProgressBar.Complete() |
| 707 | cmd.UI.DisplayNewline() |
| 708 | cmd.UI.DisplayText("Waiting for API to complete processing files...") |
| 709 | case v7pushaction.StoppingApplication: |
| 710 | cmd.UI.DisplayText("Stopping Application...") |
| 711 | case v7pushaction.StoppingApplicationComplete: |
| 712 | cmd.UI.DisplayText("Application Stopped") |
| 713 | case v7pushaction.ApplyManifest: |
| 714 | cmd.UI.DisplayText("Applying manifest...") |
| 715 | case v7pushaction.ApplyManifestComplete: |
| 716 | cmd.UI.DisplayText("Manifest applied") |
| 717 | case v7pushaction.StartingStaging: |
| 718 | cmd.UI.DisplayNewline() |
| 719 | cmd.UI.DisplayText("Staging app and tracing logs...") |
| 720 | logStream, errStream, cancelFunc, warnings, err := cmd.VersionActor.GetStreamingLogsForApplicationByNameAndSpace(appName, cmd.Config.TargetedSpace().GUID, cmd.LogCacheClient) |
| 721 | cmd.UI.DisplayWarnings(warnings) |
| 722 | if err != nil { |
| 723 | return err |
| 724 | } |
| 725 | if cmd.stopStreamingFunc != nil { |
| 726 | cmd.stopStreamingFunc() |
| 727 | } |
| 728 | cmd.stopStreamingFunc = cancelFunc |
| 729 | go cmd.getLogs(logStream, errStream) |
| 730 | case v7pushaction.StagingComplete: |
| 731 | if cmd.stopStreamingFunc != nil { |
| 732 | cmd.stopStreamingFunc() |
| 733 | cmd.stopStreamingFunc = nil |
| 734 | } |
| 735 | case v7pushaction.RestartingApplication: |
| 736 | cmd.UI.DisplayNewline() |
| 737 | cmd.UI.DisplayTextWithFlavor( |
| 738 | "Waiting for app {{.AppName}} to start...", |
| 739 | map[string]interface{}{ |
| 740 | "AppName": appName, |
| 741 | }, |
| 742 | ) |
no test coverage detected