Esempio n. 1
0
        public void puts_any_overrides_onto_profile()
        {
            var options = new DeploymentOptions();
            options.Overrides["Shared"] = "override-val";
            options.Overrides["Profile1"] = "override-profile1-val";

            var plan = new DeploymentPlan(options, new DeploymentGraph()
            {
                Environment = theEnvironment,
                Profile = theProfile,
                Recipes = theRecipes,
                Settings = new DeploymentSettings() { TargetDirectory = "target" }
            });

            plan.GetSubstitutionDiagnosticReport().Single(x => x.Key == "Shared")
                .Value.ShouldEqual("override-val");

            plan.GetSubstitutionDiagnosticReport().Single(x => x.Key == "Profile1")
                .Value.ShouldEqual("override-profile1-val");
        }
Esempio n. 2
0
        public void combine_overrides_and_provenance()
        {
            var plan = new DeploymentPlan(new DeploymentOptions(), new DeploymentGraph(){
                Environment = theEnvironment,
                Profile = theProfile,
                Recipes = theRecipes,
                Settings = new DeploymentSettings(){TargetDirectory = "target"}
            });

            plan.GetSubstitutionDiagnosticReport().ShouldHaveTheSameElementsAs(
                new SettingDataSource(){Key = "Env1", Provenance = "Environment settings", Value = "Env1-Val"},
                new SettingDataSource() { Key = "Profile1", Provenance = "Profile:  profile1", Value = "Profile1-Val" },
                new SettingDataSource() { Key = EnvironmentSettings.ROOT, Provenance = "DeploymentSettings", Value = "target" },
                new SettingDataSource() { Key = "Shared", Provenance = "Profile:  profile1", Value = "Shared-Profile-Val" }

                );
        }
Esempio n. 3
0
        private void writeEnvironmentSettings(DeploymentPlan plan)
        {
            wrapInSection("Settings", "Profile / Environment Substitutions", div =>
            {
                var report = plan.GetSubstitutionDiagnosticReport();

                div.Append(writeSettings(findProvenanceRoot(), report));
            });
        }
Esempio n. 4
0
        public void set_the_root_from_deployment_settings_if_root_is_in_neither_environment_or_profile()
        {
            var deploymentSettings = new DeploymentSettings(){
                TargetDirectory = "settings-target"
            };

            var plan = new DeploymentPlan(new DeploymentOptions(), new DeploymentGraph()
            {
                Environment = theEnvironment,
                Profile = theProfile,
                Recipes = theRecipes,
                Settings = deploymentSettings
            });

            var sourcing = plan.GetSubstitutionDiagnosticReport().Single(x => x.Key == EnvironmentSettings.ROOT);
            sourcing.Value.ShouldEqual("settings-target");
            sourcing.Provenance.ShouldEqual("DeploymentSettings");
        }