private void Reset() { txtboxInstallsPath.Enabled = true; Deployer d = new Deployer(); d.Closed += (s, args) => Close(); Hide(); d.Show(); }
public async Task Deploy(int?num = null) { var deployLog = string.Empty; try { CheckDbForExists(_connectionString); DeploySettings deploySettings = new DeploySettings() { BeginNum = num, CheckSqlPath = Path.Combine(Directory.GetCurrentDirectory(), "Scripts", "Check"), ConnectionString = _connectionString, DeploySqlPath = Path.Combine(Directory.GetCurrentDirectory(), "Scripts", "Deploy"), UpdateSqlPath = Path.Combine(Directory.GetCurrentDirectory(), "Scripts", "Update") }; var deployer = new Deployer.Deployer(deploySettings); deployer.OnError += (sender, message) => { deployLog += message + "\r\n"; _logger?.LogError(message); }; deployer.OnDebug += (sender, message) => { _logger?.LogDebug(message); }; deployer.OnMessage += (sender, message) => { _logger?.LogInformation(message); }; deployer.OnWarning += (sender, message) => { deployLog += message + "\r\n"; _logger?.LogWarning(message); }; if (!await deployer.Deploy()) { throw new DeployException($"DB was not deploy, log: {deployLog}"); } } catch (DeployException) { throw; } catch (Exception ex) { throw new DeployException($"" + $"Error while Deploy DB.\r\n" + $"Message: {ex.Message}\r\n" + $"StackTrace: {ex.StackTrace}\r\n" + $"DeployLog: {deployLog}"); } }