(octopus *octopusApiClient.Client, deployableEnvironmentIDs []string, nextDeployEnvironmentID string)
| 936 | } |
| 937 | |
| 938 | func loadEnvironmentsForDeploy(octopus *octopusApiClient.Client, deployableEnvironmentIDs []string, nextDeployEnvironmentID string) ([]*environments.Environment, string, error) { |
| 939 | envResources, err := octopus.Environments.Get(environments.EnvironmentsQuery{IDs: deployableEnvironmentIDs}) |
| 940 | if err != nil { |
| 941 | return nil, "", err |
| 942 | } |
| 943 | allEnvs, err := envResources.GetAllPages(octopus.Environments.GetClient()) |
| 944 | if err != nil { |
| 945 | return nil, "", err |
| 946 | } |
| 947 | |
| 948 | // match the next deploy environment |
| 949 | nextDeployEnvironmentName := "" |
| 950 | for _, e := range allEnvs { |
| 951 | if e.ID == nextDeployEnvironmentID { |
| 952 | nextDeployEnvironmentName = e.Name |
| 953 | break |
| 954 | } |
| 955 | } |
| 956 | return allEnvs, nextDeployEnvironmentName, nil |
| 957 | } |
| 958 | |
| 959 | func selectDeploymentEnvironment(asker question.Asker, octopus *octopusApiClient.Client, deployableEnvironmentIDs []string, nextDeployEnvironmentID string) (*environments.Environment, error) { |
| 960 | allEnvs, nextDeployEnvironmentName, err := loadEnvironmentsForDeploy(octopus, deployableEnvironmentIDs, nextDeployEnvironmentID) |
no test coverage detected