public void SetUp() { var successDetail = new DeploymentDetail(() => "success detail", () => new DeploymentResult() { new DeploymentItem(DeploymentItemStatus.Good, "verify") }, () => new DeploymentResult() { new DeploymentItem(DeploymentItemStatus.Good, "execute") }); var failDetail = new DeploymentDetail(() => "fail detail", () => new DeploymentResult() { new DeploymentItem(DeploymentItemStatus.Error, "fail verify") }, () => new DeploymentResult() { new DeploymentItem(DeploymentItemStatus.Good, "execute") }); var webRole = new DeploymentRole("Web"); webRole.AddServer(new DeploymentServer("SrvWeb1")); webRole.AddServer(new DeploymentServer("SrvWeb2")); webRole.ForEachServer(s => s.AddDetail(successDetail)); var dbRole = new DeploymentRole("Db"); dbRole.AddServer("SrvDb"); dbRole.ForEachServer(s => s.AddDetail(failDetail)); Plan = new DeploymentPlan(); Plan.AddRole(webRole); Plan.AddRole(dbRole); BecauseOf(); }
public override void Context() { base.Context(); var successDetail = new DeploymentDetail(() => "success detail", () => new DeploymentResult() { new DeploymentItem(DeploymentItemStatus.Good, "verify") }, () => new DeploymentResult() { new DeploymentItem(DeploymentItemStatus.Good, "execute") }, () => new DeploymentResult()); var failDetail = new DeploymentDetail(() => "fail detail", () => new DeploymentResult() { new DeploymentItem(DeploymentItemStatus.Error, "fail verify") }, () => new DeploymentResult() { new DeploymentItem(DeploymentItemStatus.Good, "execute") }, () => new DeploymentResult()); var webRole = new DeploymentRole("Web"); webRole.AddServer(new DeploymentServer("SrvWeb1")); webRole.AddServer(new DeploymentServer("SrvWeb2")); webRole.ForEachServerMapped(s => s.AddDetail(successDetail)); var dbRole = new DeploymentRole("Db"); dbRole.AddServer("SrvDb"); dbRole.ForEachServerMapped(s => s.AddDetail(failDetail)); Plan = new DeploymentPlan(); Plan.AddRole(webRole); Plan.AddRole(dbRole); }
public bool Look(Role role) { _currentRole = _plan.AddRole(role.Name); foreach (var serverName in _serverMappings.GetServers(role.Name)) { _currentRole.AddServer(serverName); } return(true); }
public void SetUp() { var detail = new DeploymentDetail(() => "test detail", () => new DeploymentResult() { new DeploymentItem(DeploymentItemStatus.Good, "verify") }, () => new DeploymentResult() { new DeploymentItem(DeploymentItemStatus.Good, "execute") }, () => new DeploymentResult()); var webRole = new DeploymentRole("Web"); webRole.AddServer(new DeploymentServer("SrvWeb1")); webRole.AddServer(new DeploymentServer("SrvWeb2")); webRole.ForEachServerMapped(s => s.AddDetail(detail)); var dbRole = new DeploymentRole("Db"); dbRole.AddServer("SrvDb"); dbRole.ForEachServerMapped(s => s.AddDetail(detail)); Plan = new DeploymentPlan(); Plan.AddRole(webRole); Plan.AddRole(dbRole); BecauseOf(); }
public void Execute() { bool verifyRan = false; bool executeRan = false; bool traceRan = false; var detail = new DeploymentDetail(() => { traceRan = true; return("trace"); }, () => { verifyRan = true; var r = new DeploymentResult(); r.AddGood("test:v"); return(r); }, () => { executeRan = true; var r = new DeploymentResult(); r.AddGood("test:e"); return(r); }, () => new DeploymentResult()); var web = new DeploymentRole("WEB"); web.AddServer("BILL"); web.ForEachServerMapped(s => s.AddDetail(detail)); var plan = new DeploymentPlan(); plan.AddRole(web); var args = new DeploymentArguments { Role = "WEB", Command = DeploymentCommands.Execute }; plan.Execute(); Assert.IsTrue(traceRan, "trace"); Assert.IsTrue(verifyRan, "verify"); Assert.IsTrue(executeRan, "execute"); }
public bool Look(Role role) { if (ShouldNotProcessRole(role.Name)) { return(false); } _currentRole = _plan.AddRole(role.Name); foreach (var serverName in _serverMappings.GetServers(role.Name)) { _currentRole.AddServer(serverName); } return(true); }
public void Trace() { bool verifyRan = false; bool executeRan = false; bool traceRan = false; var detail = new DeploymentDetail(() => { traceRan = true; return("trace"); }, () => { verifyRan = true; return(new DeploymentResult()); }, () => { executeRan = true; return(new DeploymentResult()); }, () => new DeploymentResult()); var web = new DeploymentRole("WEB"); web.AddServer(new DeploymentServer("bob")); web.ForEachServerMapped(s => s.AddDetail(detail)); var plan = new DeploymentPlan(); plan.AddRole(web); var args = new DeploymentArguments { Role = "WEB", Command = DeploymentCommands.Trace }; plan.Trace(); Assert.IsTrue(traceRan); Assert.IsFalse(verifyRan); Assert.IsFalse(executeRan); }