public static async Task Main(string[] args) { CheckForAdminAccess.ValidateCurrentUserIsProcessAdmin(); var enableScaleUnitFeatureOption = new CLIOption() { Name = "Initialize the hybrid topology", Command = EnableScaleUnitFeature.SelectScaleUnit }; var configureEnvironmentOption = new CLIOption() { Name = "Prepare environments for workload installation", Command = ConfigureEnvironment.Show }; var installWorkloadsOption = new CLIOption() { Name = "Install workloads", Command = InstallWorkloads.Show }; var workloadsInstallationStatusOption = new CLIOption() { Name = "Show workloads installation status", Command = WorkloadsInstallationStatus.Show }; var options = new List <CLIOption>() { enableScaleUnitFeatureOption, configureEnvironmentOption, installWorkloadsOption, workloadsInstallationStatusOption }; var screen = new CLIScreen(options, "Home", "Please select the operation you want to perform:\n", "\nOperation to perform: "); await CLIMenu.ShowScreen(screen); }
public static async Task Main(string[] args) { CLIOption enableScaleUnitFeatureOption = new CLIOption() { Name = "Enable the environment as the hub or a scale unit", Command = EnableScaleUnitFeature.Show }; CLIOption configureEnvironmentOption = new CLIOption() { Name = "Configure the environment", Command = ConfigureEnvironment.Show }; CLIOption installWorkloadsOption = new CLIOption() { Name = "Install workloads on environment", Command = InstallWorkloads.Show }; CLIOption workloadsInstallationStatusOption = new CLIOption() { Name = "Show workloads installation status", Command = WorkloadsInstallationStatus.Show }; var options = new List <CLIOption>() { enableScaleUnitFeatureOption, configureEnvironmentOption, installWorkloadsOption, workloadsInstallationStatusOption }; CLIScreen screen = new CLIScreen(options, "Home", "Please select the operation you want to perform:\n", "\nOperation to perform: "); await CLIMenu.ShowScreen(screen); }
private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(this); } }
protected async Task PrintAvailableSteps(int input, string selectionHistory) { var options = new List <CLIOption>(); AvailableSteps = GetAvailableSteps(); AvailableSteps.Sort((x, y) => x.Priority().CompareTo(y.Priority())); foreach (Step s in AvailableSteps) { options.Add(new CLIOption() { Name = s.Label(), Command = RunStepsFromTask }); } CLIScreen screen = new CLIScreen(options, selectionHistory, "Tasks to run:\n", "\nSelect task to start from: "); await CLIMenu.ShowScreen(screen); }
protected async Task PrintAvailableSteps(int input, string selectionHistory) { var options = new List <CLIOption>(); AvailableSteps = GetAvailableSteps(); AvailableSteps.Sort((x, y) => x.Priority().CompareTo(y.Priority())); foreach (IStep s in AvailableSteps) { options.Add(new CLIOption() { Name = s.Label(), Command = RunStepsFromTask }); } ScaleUnitInstance scaleUnit = Config.FindScaleUnitWithId(ScaleUnitContext.GetScaleUnitId()); CLIScreen screen = new CLIScreen(options, selectionHistory, $"Task sequence to run for {scaleUnit.PrintableName()}\n", "\nSelect task to start from: "); await CLIMenu.ShowScreen(screen); }
public static async Task SelectScaleUnit(int input, string selectionHistory) { var options = new List <CLIOption>(); List <ScaleUnitInstance> scaleUnitInstances = Config.ScaleUnitInstances(); scaleUnitInstances.Sort(); foreach (ScaleUnitInstance scaleUnit in scaleUnitInstances) { options.Add(new CLIOption() { Name = scaleUnit.PrintableName(), Command = PrintAvailableStepsForScaleUnit }); } CLIScreen screen = new CLIScreen(options, selectionHistory, "Environments:\n", "\nWhich environment would you like to configure?: "); await CLIMenu.ShowScreen(screen); }
public static async Task Show(int input, string selectionHistory) { var options = new List <CLIOption>(); List <ScaleUnitInstance> scaleUnitInstances = Config.ScaleUnitInstances(); scaleUnitInstances.Sort(); foreach (ScaleUnitInstance scaleUnit in scaleUnitInstances) { options.Add(new CLIOption() { Name = scaleUnit.PrintableName(), Command = InstallWorkloadsForScaleUnit }); } CLIScreen screen = new CLIScreen(options, selectionHistory, "Install workloads on:\n", "\nEnvironment to install the workloads on?: "); await CLIMenu.ShowScreen(screen); }
public static async Task Show(int input, string selectionHistory) { CLIOption configureHubOption = new CLIOption() { Name = "Hub", Command = new HubConfigurationManager().Configure }; CLIOption configureScaleUnitOption = new CLIOption() { Name = "Scale unit", Command = new ScaleUnitConfigurationManager().Configure }; var options = new List <CLIOption>() { configureHubOption, configureScaleUnitOption }; CLIScreen screen = new CLIScreen(options, selectionHistory, "Type of environment to configure:\n", "\nWould you like to configure the environment as the hub or a scale unit?: "); await CLIMenu.ShowScreen(screen); }
public static async Task Show(int input, string selectionHistory) { CLIOption enableScaleUnitFeatureHubOption = new CLIOption() { Name = "Hub", Command = new EnableScaleUnitFeatureOnHub().PrintAvailableSteps }; CLIOption enableScaleUnitFeatureOnScaleUnitOption = new CLIOption() { Name = "Scale Unit", Command = new EnableScaleUnitFeatureOnScaleUnit().PrintAvailableSteps }; var options = new List <CLIOption>() { enableScaleUnitFeatureHubOption, enableScaleUnitFeatureOnScaleUnitOption }; CLIScreen screen = new CLIScreen(options, selectionHistory, "Type of environment to setup:\n", "\nWould you like to setup this environment as the hub or a scale unit?: "); await CLIMenu.ShowScreen(screen); }
public static async Task Show(int input, string selectionHistory) { CLIOption installWorkloadsOnHubOption = new CLIOption() { Name = "Hub", Command = new HubWorkloadInstaller().Install }; CLIOption installWorkloadsOnScaleUnitOption = new CLIOption() { Name = "Scale unit", Command = new ScaleUnitWorkloadInstaller().Install }; var options = new List <CLIOption>() { installWorkloadsOnHubOption, installWorkloadsOnScaleUnitOption }; CLIScreen screen = new CLIScreen(options, selectionHistory, "Install workloads on:\n", "\nEnvironment to install the workloads on?: "); await CLIMenu.ShowScreen(screen); }
public static async Task Show(int input, string selectionHistory) { CLIOption WorkloadsInstallationStatusOnHubOption = new CLIOption() { Name = "Hub", Command = new HubWorkloadInstaller().InstallationStatus }; CLIOption WorkloadsInstallationStatusOnScaleUnitOption = new CLIOption() { Name = "Scale unit", Command = new ScaleUnitWorkloadInstaller().InstallationStatus }; var options = new List <CLIOption>() { WorkloadsInstallationStatusOnHubOption, WorkloadsInstallationStatusOnScaleUnitOption }; CLIScreen screen = new CLIScreen(options, selectionHistory, "Show status of workloads installation on:\n", "\nEnvironment?: "); await CLIMenu.ShowScreen(screen); }
private async Task RunStepsFromTask(int input, string selectionHistory) { for (int i = input - 1; i < AvailableSteps.Count; i++) { try { Console.WriteLine("Executing step: " + AvailableSteps[i].Label()); await AvailableSteps[i].Run(); } catch (Exception) { if (!CLIMenu.YesNoPrompt("Step " + AvailableSteps[i].Label() + " failed to complete successfuly. Do you want to continue? [y]: ")) { break; } } } Console.WriteLine("Done"); }