예제 #1
0
        public RoleToServerMap Parse(FileInfo file)
        {
            var binder = ConfigurationBinderFactory.New(c =>
            {
                //c.AddJsonFile(file.FullName);
                var content = File.ReadAllText(file.FullName);
                c.AddJson(content);
            });


            var d = binder.GetAll();

            var result = new RoleToServerMap();



            foreach (var kvp in d)
            {
                result.AddMap(kvp.Key, kvp.Value.ToString());
            }



            return(result);
        }
예제 #2
0
        public DeploymentPlan GetPlan(Deployment deployment, RoleToServerMap serverMappings)
        {
            _serverMappings = serverMappings;

            deployment.InspectWith(this);

            return(_plan);
        }
        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);
        }
예제 #4
0
        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);
        }
예제 #6
0
        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);
        }
예제 #7
0
        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);
        }
예제 #8
0
        public void TryDb()
        {
            var dep = new TwoRoleDeploy();

            dep.Initialize(new SampleConfiguration());

            var maps = new RoleToServerMap();

            maps.AddMap("DB", "BOB");
            maps.AddMap("WEB", "BILL");

            var ins = new DropkickDeploymentInspector(maps);

            ins.RolesToGet("Db");

            var plan = ins.GetPlan(dep);

            Assert.AreEqual(1, plan.RoleCount);
        }
예제 #9
0
        public RoleToServerMap Parse(FileInfo file)
        {
            var binder = ConfigurationBinderFactory.New(c =>
            {
                var content = File.ReadAllText(file.FullName);
                c.AddJson(content);
            });

            var d = binder.GetAll();

            var result = new RoleToServerMap();

            foreach (var kvp in d)
            {
                result.AddMap(
                    stripIndexerFromKey(kvp.Key),
                    kvp.Value.ToString());
            }
            return result;
        }
예제 #10
0
 public DeploymentArguments()
 {
     Command        = DeploymentCommands.Trace;
     Role           = "ALL";
     ServerMappings = new RoleToServerMap();
 }
예제 #11
0
 public DeploymentArguments()
 {
     Command = DeploymentCommands.Trace;
     Role = "ALL";
     ServerMappings = new RoleToServerMap();
 }
예제 #12
0
 public DropkickDeploymentInspector(RoleToServerMap maps) :
     base("Look")
 {
     _serverMappings = maps;
 }