public DeploymentArguments() { ServerMappings = new RoleToServerMap(); Environment = "LOCAL"; Role = "ALL"; Deployment = "SEARCH"; Command = DeploymentCommands.Trace; SettingsPath = ".\\settings"; }
public DeploymentArguments() { ServerMappings = new RoleToServerMap(); Environment = "LOCAL"; Role = "ALL"; Deployment = "SEARCH"; Command = DeploymentCommands.Trace; SettingsDirectory = ".\\settings"; }
public void Merge(RoleToServerMap map) { foreach (var mapping in map._mappings) { foreach (var server in mapping.Value) { _mappings[mapping.Key].Add(server); } } }
public void Merge(RoleToServerMap map) { foreach (var mapping in map._mappings) { foreach (var server in mapping.Value) { _mappings[mapping.Key].Add(server); } } }
public void EstablishContext() { Deployment = new TwoRoleDeploy(); Deployment.Initialize(new SampleConfiguration()); Map = new RoleToServerMap(); Map.AddMap("Web", "SrvTopeka09"); Map.AddMap("Web", "SrvTopeka19"); Inspector = new DropkickDeploymentInspector(Map); }
public void EstablishContext() { Deployment = new TwoPartDeploy(); Inspector = new DropkickDeploymentInspector(); Map = new RoleToServerMap(); Map.AddMap("Web", "SrvTopeka09"); Map.AddMap("Web", "SrvTopeka19"); Map.AddMap("Db", "SrvTopeka02"); BecauseOf(); }
public void TryWeb() { var dep = new TwoPartDeploy(); var maps = new RoleToServerMap(); maps.AddMap("WEB", "BOB"); var ins = new DropkickDeploymentInspector(); var plan = ins.GetPlan(dep, maps); Assert.AreEqual(1, plan.RoleCount); }
public void TryAll() { var dep = new TwoRoleDeploy(); dep.Initialize(new object()); var maps = new RoleToServerMap(); maps.AddMap("DB", "BOB"); var ins = new DropkickDeploymentInspector(maps); var plan = ins.GetPlan(dep); Assert.AreEqual(2, plan.RoleCount); }
static void DisplayServerMappingsForEnvironment(RoleToServerMap mappings) { _coarseLog.Debug(""); _coarseLog.Info("Server Mappings"); foreach (var role in mappings.Roles()) { _coarseLog.InfoFormat(" '{0}'", role); foreach (var server in mappings.GetServers(role)) { _coarseLog.InfoFormat(" '{0}'", server.Name); } } }
public void TryDb() { var dep = new TwoRoleDeploy(); dep.Initialize(new SampleConfiguration()); var maps = new RoleToServerMap(); maps.AddMap("DB","BOB"); var ins = new DropkickDeploymentInspector(maps); ins.RolesToGet("Db"); var plan = ins.GetPlan(dep); Assert.AreEqual(1, plan.RoleCount); }
public void TryWeb() { var dep = new TwoRoleDeploy(); dep.Initialize(new object()); var maps = new RoleToServerMap(); var ins = new DropkickDeploymentInspector(maps); ins.RolesToGet("Web"); //how to set the roles var plan = ins.GetPlan(dep); Assert.AreEqual(1, plan.RoleCount); }
static void DisplayServerMappingsForEnvironment(RoleToServerMap mappings) { _coarseLog.Debug(""); _coarseLog.Info("Server Mappings"); foreach (var role in mappings.Roles()) { _coarseLog.InfoFormat(" '{0}'", role); foreach (var server in mappings.GetServers(role)) { _coarseLog.InfoFormat(" '{0}'", server.Name); } } }
public static void Deploy(string commandLine) { if (!_coarseLog.IsDebugEnabled) { Console.WriteLine("Sad Emo Otter says \"DEBUG LOGGING IS OFF - THIS ISN'T GOING TO BE FUN :(\""); } try { _coarseLog.Info("****************************************************"); _coarseLog.Info("DropkicK"); _coarseLog.Info("****************************************************"); _coarseLog.Info(""); DeploymentArguments newArgs = DeploymentCommandLineParser.Parse(commandLine); _coarseLog.Info("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); _coarseLog.InfoFormat("Command: {0}", newArgs.Command); _coarseLog.InfoFormat("Environment: {0}", newArgs.Environment); _coarseLog.InfoFormat("Role: {0}", newArgs.Role); //////// DEPLOYMENT STUFF FindResult findResult = _finder.Find(newArgs.Deployment); Deployment deployment = findResult.Deployment; _coarseLog.InfoFormat("Deployment Method: '{0}'", findResult.MethodOfFinding); _coarseLog.InfoFormat("Deployment Found: '{0}'", findResult.Deployment.GetType().Name); if (deployment.GetType().Equals(typeof(NullDeployment))) { _coarseLog.Fatal("Couldn't find a deployment to run."); return; } //////// ////////// File Checks if (!VerifyPathToServerMapsFile(newArgs.PathToServerMapsFile)) { return; } if (!VerifyPathToSettingsFile(newArgs.PathToSettingsFile)) { return; } //////////////////// RoleToServerMap maps = _serverParser.Parse(new FileInfo(newArgs.PathToServerMapsFile)); newArgs.ServerMappings.Merge(maps); DisplayServerMappingsForEnvironment(newArgs.ServerMappings); _coarseLog.Info(""); _coarseLog.Info("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); _coarseLog.Info("Please review the settings above when you are ready,"); _coarseLog.Info(" Press 'ctrl+c' to cancel."); if (deployment.HardPrompt) { bool wrong = true; do { _coarseLog.Info(" Please type the environment name '{0}' to continue.".FormatWith(newArgs.Environment)); var environment = Console.ReadLine(); if (environment.EqualsIgnoreCase(newArgs.Environment)) { wrong = false; } } while (wrong); } else { _coarseLog.Info(" Press enter to kick it out there"); Console.ReadKey(true); } /////// how to clean this up - below Type settingsType = deployment.GetType().BaseType.GetGenericArguments()[1]; var settings = (DropkickConfiguration)_parser.Parse(settingsType, new FileInfo(newArgs.PathToSettingsFile), commandLine, newArgs.Environment); settings.Environment = newArgs.Environment; deployment.Initialize(settings); DeploymentPlanDispatcher.KickItOutThereAlready(deployment, newArgs); } catch (Exception ex) { _coarseLog.Debug(commandLine); _coarseLog.Error(ex); } }