public WwwInstaller(CLIContext context) { Context = context; Starter = new ProcessStarter(context.IndexDirectory); Verifier = new WwwVerifier(context); SystemCtl = new SystemCtlHelper(context); }
public void Test_Install() { MoveToTemporaryDirectory(); var random = new Random(); var settings = new CLISettings(); settings.SmtpServer = "smtp.myserver" + random.Next(1000, 9000) + ".com"; settings.SmtpUsername = "******" + random.Next(1000, 9000); settings.SmtpPassword = "******" + random.Next(1000, 9000); settings.Email = "me@mydomain" + random.Next(1000, 9000) + ".com"; settings.IsMockSystemCtl = true; var context = new CLIContext(Environment.CurrentDirectory, settings); var installer = new ArduinoPlugAndPlayInstaller(context); installer.Verifier.SystemCtl = new MockSystemCtlHelper(context); installer.EnsureInstallDirectoryExists(); var installPath = installer.GetInstallPath(); //File.WriteAllText(Path.Combine(installPath, "is-mock-systemctl.txt"), "true"); installer.Install(); //var starter = new ProcessStarter(); //starter.StartBash("sudo systemctl disable arduino-plug-and-play.service"); //starter.StartBash("sudo systemctl stop arduino-plug-and-play.service"); }
public MqttBridgeInstaller(CLIContext context) { Context = context; Starter = new ProcessStarter(context.IndexDirectory); Docker = new DockerHelper(context); Verifier = new MqttBridgeVerifier(context); Services = new MqttBridgeServiceManager(context); }
public UIControllerInstaller(CLIContext context) { Context = context; Starter = new ProcessStarter(context.IndexDirectory); Docker = new DockerHelper(context); Verifier = new UIControllerVerifier(context); Services = new UIControllerServiceManager(context); }
public MosquittoInstaller(CLIContext context) { Context = context; Starter = new ProcessStarter(context.IndexDirectory); Docker = new DockerHelper(context); Verifier = new MosquittoVerifier(context); SystemCtl = new SystemCtlHelper(context); }
public void Test_Install() { MoveToTemporaryDirectory(); var context = new CLIContext(Environment.CurrentDirectory, new CLISettings()); var installer = new DockerInstaller(context); installer.Verifier.SystemCtl = new MockSystemCtlHelper(context); installer.Install(); }
private void saveSetting(CLIContext context) { var filePath = Path.Combine(context.DataDirectoryFullPath, settingFileName); if (!File.Exists(filePath)) { throw new Exception($"file not found({filePath})."); } var json = JsonConvert.SerializeObject(setting); File.WriteAllText(filePath, json); }
static void Main(string[] args) { var context = new CLIContext(Environment.CurrentDirectory); var commandContainer = new CLICommandsContainer { { new CLICommandConfig("my command"), new MyCommand() }, { new CLICommandConfig("with initialize"), new MyCommandWithInitialize() } }; using (var driver = new Driver(commandContainer, context)) { driver.Run(); } }
public void Initialize(CLIContext context) { this.context = context; CLIConsole.WriteLine($"({GetType().Name})Loading setting file..."); var filePath = Path.Combine(this.context.DataDirectoryFullPath, settingFileName); if (!File.Exists(filePath)) { File.Create(filePath).Close(); saveSetting(context); } setting = loadSetting(filePath); }
static void Main(string[] args) { CLIConsole.WriteLine("Welcome to ClArc"); CLIConsole.WriteLine(); var commands = new CLICommandsContainer { { new CLICommandConfig("GenerateDefaultWebProject"), new CreateDefaultWebProjectCommand() }, { new CLICommandConfig("UseCase"), new CreateUseCaseCommand() }, }; var context = new CLIContext(Environment.CurrentDirectory); using (var driver = new Driver(commands, context)) { driver.Run(); } }
public void Test_Install() { MoveToTemporaryDirectory(); PullDirectoryFromProject("/"); File.WriteAllText(Path.GetFullPath("is-mock-systemctl.txt"), "true"); var settings = new CLISettings(); var context = new CLIContext(Environment.CurrentDirectory, settings); var installer = new SupervisorInstaller(context); installer.Verifier.SystemCtl = new MockSystemCtlHelper(context); installer.Install(); }
public PostInstaller(CLIContext context) { Context = context; Python = new PythonInstaller(); Docker = new DockerInstaller(context); PlatformIO = new PlatformIOInstaller(); Mqtt = new MosquittoInstaller(context); MqttBridge = new MqttBridgeInstaller(context); UIController = new UIControllerInstaller(context); ArduinoPlugAndPlay = new ArduinoPlugAndPlayInstaller(context); Supervisor = new SupervisorInstaller(context); WWW = new WwwInstaller(context); SettingsManager = new SettingsManager(context.IndexDirectory); Verifier = new Verifier(context); }
public Verifier(CLIContext context) : base(context) { Context = context; Docker = new DockerVerifier(context); ArduinoPlugAndPlay = new ArduinoPlugAndPlayVerifier(context); Mosquitto = new MosquittoVerifier(context); MqttBridge = new MqttBridgeVerifier(context); UIController = new UIControllerVerifier(context); Settings = new SettingsVerifier(context); Supervisor = new SupervisorVerifier(context); WWW = new WwwVerifier(context); Version = new VersionVerifier(context); Console.WriteLine("GrowSense installation verified"); }
public void Test_Initialize_IndexPath() { MoveToTemporaryDirectory(); var startingDirectory = Environment.CurrentDirectory; var settings = new CLISettings(); var context = new CLIContext(startingDirectory, settings); var paths = new PathHelper(context); paths.Initialize(startingDirectory); var expectedParentPath = Path.GetFullPath(Environment.CurrentDirectory + "/../../").TrimEnd('/'); Assert.AreEqual(expectedParentPath, context.ParentDirectory, "Parent path is not set correctly."); var expectedIndexDirectory = Environment.CurrentDirectory; Assert.AreEqual(expectedIndexDirectory, context.IndexDirectory, "Index directory is not set correctly."); }
public void Test_Install() { MoveToTemporaryDirectory(); PullDirectoryFromProject("scripts/apps/Serial1602ShieldSystemUIController/"); var random = new Random(); var settings = new CLISettings(); settings.MqttUsername = "******" + random.Next(1000, 9000); settings.MqttPassword = "******" + random.Next(1000, 9000); settings.MqttHost = "10.0.0." + random.Next(0, 240); settings.SmtpServer = "smtp.myserver" + random.Next(1000, 9000) + ".com"; settings.SmtpUsername = "******" + random.Next(1000, 9000); settings.SmtpPassword = "******" + random.Next(1000, 9000); settings.Email = "me@mydomain" + random.Next(1000, 9000) + ".com"; var context = new CLIContext(Environment.CurrentDirectory, settings); var uiControllerInstaller = new UIControllerInstaller(context); uiControllerInstaller.Install(); }
public void Test_Install() { MoveToTemporaryDirectory(); PullDirectoryFromProject("scripts/apps/BridgeArduinoSerialToMqttSplitCsv/"); var random = new Random(); var settings = new CLISettings(); settings.MqttUsername = "******" + random.Next(1000, 9000); settings.MqttPassword = "******" + random.Next(1000, 9000); settings.MqttHost = "10.0.0." + random.Next(0, 240); settings.SmtpServer = "smtp.myserver" + random.Next(1000, 9000) + ".com"; settings.SmtpUsername = "******" + random.Next(1000, 9000); settings.SmtpPassword = "******" + random.Next(1000, 9000); settings.Email = "me@mydomain" + random.Next(1000, 9000) + ".com"; var context = new CLIContext(Environment.CurrentDirectory, settings); var mqttBridgeInstaller = new MqttBridgeInstaller(context); mqttBridgeInstaller.Install(); }
public void Test_Install() { MoveToTemporaryDirectory(); PullFileFromProject("scripts/docker/mosquitto/data/mosquitto.conf"); var random = new Random(); var settings = new CLISettings(); settings.MqttUsername = "******" + random.Next(1000, 9000); settings.MqttPassword = "******" + random.Next(1000, 9000); var context = new CLIContext(Environment.CurrentDirectory, settings); var mosquittoInstaller = new MosquittoInstaller(context); mosquittoInstaller.Docker = new MockDockerHelper(context); mosquittoInstaller.Verifier.Docker = mosquittoInstaller.Docker; mosquittoInstaller.SystemCtl = new MockSystemCtlHelper(context); mosquittoInstaller.Install(); mosquittoInstaller.Docker.Remove("mosquitto", true); }
public MockDockerHelper(CLIContext context) : base(context) { }
public BaseVerifier(CLIContext context) { Context = context; Starter = new ProcessStarter(context.IndexDirectory); SystemCtl = new SystemCtlHelper(context); }
public DockerHelper(CLIContext context) { Context = context; Starter = new ProcessStarter(context.IndexDirectory); }
public SystemCtlHelper(CLIContext context) { Context = context; Starter = new ProcessStarter(Context.IndexDirectory); }
private bool CheckSetting(CLIContext context) { if (setting.IsSetuped) { if (ValidSolution(setting.SolutionFullPath) && ValidProject(setting.WebProjectDirectoryPath)) { CLIConsole.WriteLine("Current target solution is " + setting.SolutionFullPath); var result = Prompt.ShowYesNoPrompt("Would you want to change project directory?", YesNoPrompt.Result.No); switch (result) { case YesNoPrompt.Result.Yes: setting.Clear(); break; case YesNoPrompt.Result.No: return(true); default: return(false); } } else { setting.Clear(); } } if (!setting.IsSetuped) { while (!setting.IsSetupSolution) { var(isQuit, input) = Prompt.ShowQuitable(@"Type your solution by full path."); if (isQuit) { return(false); } if (ValidSolution(input)) { CLIConsole.WriteLine("Solution file accepted"); setting.SaveSolutionFullPath(input); saveSetting(context); } else { CLIConsole.WriteLine("The file is not solution file."); } } while (!setting.IsSetupWebProject) { var(isQuit, input) = Prompt.ShowQuitable(@"Type your web project directory by full path."); if (isQuit) { return(false); } if (ValidProject(input)) { CLIConsole.WriteLine("Project direcotry accepted"); setting.SaveWebProjectFullPath(input); saveSetting(context); } else { CLIConsole.WriteLine("The file is not web project directory."); } } } return(true); }
public ArduinoPlugAndPlayVerifier(CLIContext context) : base(context) { SystemCtl = new SystemCtlHelper(context); }
public MqttBridgeServiceManager(CLIContext context) { Context = context; SystemCtl = new SystemCtlHelper(context); Verifier = new MqttBridgeServiceVerifier(context); }
public ArduinoPlugAndPlayInstaller(CLIContext context) { Context = context; Starter = new ProcessStarter(context.IndexDirectory); Verifier = new ArduinoPlugAndPlayVerifier(context); }
public DockerInstaller(CLIContext context) { Context = context; Verifier = new DockerVerifier(context); }
public UIControllerVerifier(CLIContext context) : base(context) { }
public MosquittoVerifier(CLIContext context) { Docker = new DockerHelper(context); Context = context; }
public WwwVerifier(CLIContext context) : base(context) { }
public UIControllerServiceManager(CLIContext context) { Context = context; SystemCtl = new SystemCtlHelper(context); Verifier = new UIControllerServiceVerifier(context); }