Example #1
0
        public void SetUp()
        {
            var writer = new DeploymentWriter("profile1");

            defineTheProfile(writer);
            writer.Flush(FlushOptions.Wipeout);
        }
Example #2
0
        public override void SetUp(ITestContext context)
        {
            _settings = new DeploymentSettings("storyteller");
            context.Store(_settings);

            _writer = new DeploymentWriter("storyteller");
        }
        public void SetUp()
        {
            var writer = new DeploymentWriter("profile2");

            var host = writer.RecipeFor("r1").HostFor("h1");

            host.AddDirective(new SimpleSettings{
                One = "one",
                Two = "two"
            });

            host.AddDirective(new OneSettings()
                              {
                                  Name = "Jeremy",
                                  Age = 37
                              });

            host.AddReference(new BottleReference()
                              {
                                  Name = "bottle1"
                              });

            host.AddReference(new BottleReference()
                              {
                                  Name = "bottle2"
                              });

            writer.Flush(FlushOptions.Wipeout);

            var env = new EnvironmentSettings();
            theHost = HostReader.ReadFrom("profile2/recipes/r1/h1.host");
        }
Example #4
0
        public void SetUp()
        {
            var writer = new DeploymentWriter("profile2");

            var host = writer.RecipeFor("r1").HostFor("h1");

            host.AddDirective(new SimpleSettings {
                One = "one",
                Two = "two"
            });

            host.AddDirective(new OneSettings()
            {
                Name = "Jeremy",
                Age  = 37
            });

            host.AddReference(new BottleReference()
            {
                Name = "bottle1"
            });

            host.AddReference(new BottleReference()
            {
                Name = "bottle2"
            });

            writer.Flush(FlushOptions.Wipeout);

            theHost = HostReader.ReadFrom("profile2/recipes/r1/h1.host", new EnvironmentSettings());
        }
        public void SetUp()
        {
            var writer = new DeploymentWriter("clonewars");

            var recipeDefinition = writer.RecipeFor("r1");
            var host = recipeDefinition.HostFor("h1");

            host.AddDirective(new SimpleSettings
            {
                One = "one",
                Two = "two"
            });

            host.AddDirective(new OneSettings()
            {
                Name = "Jeremy",
                Age = 37
            });

            host.AddReference(new BottleReference()
            {
                Name = "bottle1"
            });

            host.AddReference(new BottleReference()
            {
                Name = "bottle2"
            });

            recipeDefinition.HostFor("h2").AddProperty<ThreeSettings>(x => x.Direction, "North");
            recipeDefinition.HostFor("h3").AddProperty<TwoSettings>(x => x.City, "Austin");

            writer.RecipeFor("r2").HostFor("h3").AddProperty<SimpleSettings>(x => x.One, "one");
            writer.RecipeFor("r3").HostFor("h3").AddProperty<SimpleSettings>(x => x.Two, "two");
            writer.RecipeFor("r4").HostFor("h4").AddProperty<SimpleSettings>(x => x.Two, "ten");
            writer.RecipeFor("r4").HostFor("h5").AddProperty<SimpleSettings>(x => x.Two, "ten");
            writer.RecipeFor("r4").HostFor("h5").AddProperty<SimpleSettings>(x => x.One, "*{dbName}*");

            writer.AddEnvironmentSetting<SimpleSettings>(x => x.Two, "h4", "env-value");
            writer.AddEnvironmentSetting("dbName", "blue");

            writer.ProfileFor("default").AddRecipe("r1");
            writer.ProfileFor("default").AddRecipe("r2");
            writer.ProfileFor("default").AddRecipe("r3");
            writer.ProfileFor("default").AddRecipe("r4");

            writer.Flush(FlushOptions.Wipeout);

            var settings = new DeploymentSettings("clonewars");
            var reader = new DeploymentGraphReader(settings);
            var options = new DeploymentOptions("default");
            var graph = reader.Read(options);
            thePlan = new DeploymentPlan(options, graph);

            theHosts = thePlan.Hosts;
        }
Example #6
0
        public void SetUp()
        {
            var writer = new DeploymentWriter("starwars");

            var recipeDefinition = writer.RecipeFor("r1");
            var host             = recipeDefinition.HostFor("h1");

            host.AddDirective(new SimpleSettings
            {
                One = "one",
                Two = "two"
            });

            host.AddDirective(new OneSettings()
            {
                Name = "Jeremy",
                Age  = 37
            });

            host.AddReference(new BottleReference()
            {
                Name = "bottle1"
            });

            host.AddReference(new BottleReference()
            {
                Name = "bottle2"
            });

            recipeDefinition.HostFor("h2").AddProperty <ThreeSettings>(x => x.Direction, "North");
            recipeDefinition.HostFor("h3").AddProperty <TwoSettings>(x => x.City, "Austin");


            writer.RecipeFor("r2").HostFor("h3").AddProperty <SimpleSettings>(x => x.One, "one");
            writer.RecipeFor("r3").HostFor("h3").AddProperty <SimpleSettings>(x => x.Two, "two");
            writer.RecipeFor("r4").HostFor("h4").AddProperty <SimpleSettings>(x => x.Two, "ten");
            writer.RecipeFor("r4").HostFor("h5").AddProperty <SimpleSettings>(x => x.Two, "ten");
            writer.RecipeFor("r4").HostFor("h5").AddProperty <SimpleSettings>(x => x.One, "setting is {setting}");


            writer.Flush(FlushOptions.Wipeout);

            var environmentSettings = new EnvironmentSettings();

            environmentSettings.Overrides["setting"] = "environment setting";

            theRecipes = RecipeReader.ReadRecipes("starwars\\recipes", environmentSettings);
        }
Example #7
0
        public void SetUp()
        {
            var writer = new DeploymentWriter("clonewars");

            var recipeDefinition = writer.RecipeFor("r1");
            var host             = recipeDefinition.HostFor("h1");

            host.AddDirective(new SimpleSettings
            {
                One = "one",
                Two = "two"
            });

            host.AddDirective(new OneSettings()
            {
                Name = "Jeremy",
                Age  = 37
            });

            host.AddReference(new BottleReference()
            {
                Name = "bottle1"
            });

            host.AddReference(new BottleReference()
            {
                Name = "bottle2"
            });

            recipeDefinition.HostFor("h2").AddProperty <ThreeSettings>(x => x.Direction, "North");
            recipeDefinition.HostFor("h3").AddProperty <TwoSettings>(x => x.City, "Austin");


            writer.RecipeFor("r2").HostFor("h3").AddProperty <SimpleSettings>(x => x.One, "one");
            writer.RecipeFor("r3").HostFor("h3").AddProperty <SimpleSettings>(x => x.Two, "two");
            writer.RecipeFor("r4").HostFor("h4").AddProperty <SimpleSettings>(x => x.Two, "ten");
            writer.RecipeFor("r4").HostFor("h5").AddProperty <SimpleSettings>(x => x.Two, "ten");
            writer.RecipeFor("r4").HostFor("h5").AddProperty <SimpleSettings>(x => x.One, "*{dbName}*");

            writer.AddEnvironmentSetting <SimpleSettings>(x => x.Two, "h4", "env-value");
            writer.AddEnvironmentSetting("dbName", "blue");

            writer.Flush(FlushOptions.Wipeout);

            var reader = new ProfileReader(new RecipeSorter(), new DeploymentSettings("clonewars"), new FileSystem());

            theHosts = reader.Read();
        }
Example #8
0
        public void DeployWebsite()
        {
            var testRoot = Path.GetFullPath(@".\integration");

            var writer = new DeploymentWriter(testRoot, new FileSystem());

            writer.AddEnvironmentSetting("name", "dru");


            var r = writer.RecipeFor("FubuTestApplication");

            var h = r.HostFor("web");

            var d = new FubuWebsite();

            d.WebsiteName         = "test";
            d.WebsitePhysicalPath = @"C:\dev\test-web";
            d.VDir             = "bob";
            d.VDirPhysicalPath = @"C:\dev\test-app";
            d.HostBottle       = "FubuTestApplication";
            d.AppPool          = "fubu-test";

            h.AddDirective(d);

            writer.Flush(FlushOptions.Wipeout);

            //copy over bottles
            var fileName    = "FubuTestApplication.zip";
            var destination = @".\integration\bottles\";

            Directory.CreateDirectory(destination);
            File.Copy(@"C:\Users\dsellers.fcs\Desktop\ProfileScratch\FubuTestApplication.zip", Path.Combine(destination, fileName), true);
            //<stop>


            var settings = new DeploymentSettings(testRoot)
            {
                UserForced = true
            };

            var container            = DeploymentBootstrapper.Bootstrap(settings);
            var deploymentController = container.GetInstance <IDeploymentController>();

            deploymentController.Deploy();
        }
Example #9
0
        public void SetUp()
        {
            var writer = new DeploymentWriter("profile3");

            var recipeDefinition = writer.RecipeFor("r1");

            recipeDefinition.RegisterDependency("the-pig");
            recipeDefinition.RegisterDependency("freestate");

            var host = recipeDefinition.HostFor("h1");

            host.AddDirective(new SimpleSettings
            {
                One = "one",
                Two = "two"
            });

            host.AddDirective(new OneSettings()
            {
                Name = "Jeremy",
                Age  = 37
            });

            host.AddReference(new BottleReference()
            {
                Name = "bottle1"
            });

            host.AddReference(new BottleReference()
            {
                Name = "bottle2"
            });

            recipeDefinition.HostFor("h2").AddProperty <ThreeSettings>(x => x.Direction, "North");
            recipeDefinition.HostFor("h3").AddProperty <TwoSettings>(x => x.City, "Austin");


            writer.Flush(FlushOptions.Wipeout);


            theRecipe = RecipeReader.ReadFrom("profile3/recipes/r1", new EnvironmentSettings());
        }
Example #10
0
        public void SetUp()
        {
            var writer = new DeploymentWriter("profile3");

            var recipeDefinition = writer.RecipeFor("r1");
            recipeDefinition.RegisterDependency("the-pig");
            recipeDefinition.RegisterDependency("freestate");

            var host = recipeDefinition.HostFor("h1");

            host.AddDirective(new SimpleSettings
            {
                One = "one",
                Two = "two"
            });

            host.AddDirective(new OneSettings()
            {
                Name = "Jeremy",
                Age = 37
            });

            host.AddReference(new BottleReference()
            {
                Name = "bottle1"
            });

            host.AddReference(new BottleReference()
            {
                Name = "bottle2"
            });

            recipeDefinition.HostFor("h2").AddProperty<ThreeSettings>(x => x.Direction, "North");
            recipeDefinition.HostFor("h3").AddProperty<TwoSettings>(x => x.City, "Austin");

            writer.Flush(FlushOptions.Wipeout);

            theRecipe = RecipeReader.ReadFrom("profile3/recipes/r1");
        }
        private void writeDeploymentFiles()
        {
            new FileSystem().CleanDirectory(_deploymentFolderPath);
            var writer = new DeploymentWriter(_deploymentFolderPath);

            writer.RecipeFor("r1");
            writer.RecipeFor("r2");
            writer.RecipeFor("r3");
            writer.RecipeFor("r4");
            writer.RecipeFor("r5");

            writer.ProfileFor("depprofile").AddRecipe("r3");
            writer.ProfileFor("depprofile").AddProperty<ProfileConfigRoundTripSettings>(x => x.Bar, "original bar value");
            writer.ProfileFor("depprofile").AddProperty<ProfileConfigRoundTripSettings>(x => x.Foo, "foo depprofile {dbName}");

            writer.ProfileFor("settingsdepprofile").AddRecipe("r5");
            writer.ProfileFor("settingsdepprofile").AddProperty<ProfileConfigRoundTripSettings>(x => x.Bar, "another bar value");
            writer.ProfileFor("settingsdepprofile").AddProperty<ProfileConfigRoundTripSettings>(x => x.Foo, "baz settingsdepprofile {instancevar}");

            writer.ProfileFor("main").AddRecipe("r1");
            writer.ProfileFor("main").AddRecipe("r2");
            writer.ProfileFor("main").AddProfileDependency("depprofile");
            writer.ProfileFor("main").AddProperty("dbName", "profile-db");
            writer.ProfileFor("main").AddProperty<ProfileConfigRoundTripSettings>(x => x.Bar, "Bar value");

            writer.ProfileFor("mainsettings").AddRecipe("r4");
            writer.ProfileFor("mainsettings").AddProfileDependency("settingsdepprofile");
            writer.ProfileFor("mainsettings").AddProperty("instancevar", "instanceName");
            writer.ProfileFor("mainsettings").AddProperty<ProfileConfigRoundTripSettings>(x => x.Bar, "mainsettings Bar value");

            writer.Flush(FlushOptions.Wipeout);

            //var settings = new DeploymentSettings("profile_config_writer_tests/deployment");
            //var reader = new DeploymentGraphReader(settings);
            //var options = new DeploymentOptions("main");
            //var graph = reader.Read(options);
            //thePlan = new DeploymentPlan(options, graph);
        }
 private void setupValidDeploymentFolderAt(string name)
 {
     var pr = new DeploymentWriter(name);
     pr.Flush(FlushOptions.Wipeout);
 }
        public void SetUp()
        {
            var writer = new DeploymentWriter("starwars");

            var recipeDefinition = writer.RecipeFor("r1");
            var host = recipeDefinition.HostFor("h1");

            host.AddDirective(new SimpleSettings
            {
                One = "one",
                Two = "two"
            });

            host.AddDirective(new OneSettings()
            {
                Name = "Jeremy",
                Age = 37
            });

            host.AddReference(new BottleReference()
            {
                Name = "bottle1"
            });

            host.AddReference(new BottleReference()
            {
                Name = "bottle2"
            });

            recipeDefinition.HostFor("h2").AddProperty<ThreeSettings>(x => x.Direction, "North");
            recipeDefinition.HostFor("h3").AddProperty<TwoSettings>(x => x.City, "Austin");

            writer.RecipeFor("r2").HostFor("h3").AddProperty<SimpleSettings>(x => x.One, "one");
            writer.RecipeFor("r3").HostFor("h3").AddProperty<SimpleSettings>(x => x.Two, "two");
            writer.RecipeFor("r4").HostFor("h4").AddProperty<SimpleSettings>(x => x.Two, "ten");
            writer.RecipeFor("r4").HostFor("h5").AddProperty<SimpleSettings>(x => x.Two, "ten");
            writer.RecipeFor("r4").HostFor("h5").AddProperty<SimpleSettings>(x => x.One, "setting is {setting}");

            writer.Flush(FlushOptions.Wipeout);

            var environmentSettings = new EnvironmentSettings();
            environmentSettings.Overrides["setting"] = "environment setting";

            theRecipes = RecipeReader.ReadRecipes("starwars\\recipes", environmentSettings);
        }
 protected abstract void defineTheProfile(DeploymentWriter writer);
 public void SetUp()
 {
     var writer = new DeploymentWriter("profile1");
     defineTheProfile(writer);
     writer.Flush(FlushOptions.Wipeout);
 }
Example #16
0
 protected abstract void defineTheProfile(DeploymentWriter writer);
Example #17
0
        private void setupValidDeploymentFolderAt(string name)
        {
            var pr = new DeploymentWriter(name);

            pr.Flush(FlushOptions.Wipeout);
        }