コード例 #1
0
 private static void CleanEnvironment(CommerceOps.Container container, string environment)
 {
     using (new SampleMethodScope())
     {
         var result = Proxy.GetValue(container.CleanEnvironment(environment));
         result.ResponseCode.Should().Be("Ok");
     }
 }
コード例 #2
0
 private static void Bootstrap(CommerceOps.Container container)
 {
     using (new SampleMethodScope())
     {
         var result = Proxy.GetValue(container.Bootstrap());
         result.ResponseCode.Should().Be("Ok");
     }
 }
コード例 #3
0
 public static void InitializeEnvironment(CommerceOps.Container container, string environmentName)
 {
     using (new SampleMethodScope())
     {
         var result = Proxy.GetValue(container.InitializeEnvironment(environmentName));
         result.WaitUntilCompletion();
     }
 }
コード例 #4
0
 public static void InitializeEnvironment(CommerceOps.Container container, string environmentName, bool sampleData = true)
 {
     using (new SampleMethodScope())
     {
         var result = Proxy.DoOpsCommand(container.InitializeEnvironment(environmentName, sampleData));
         result.WaitUntilCompletion();
     }
 }
        public CommerceOps.Container MinionsContainer()
        {
            var container = new CommerceOps.Container(new Uri(Console.Program.MinionsServiceUri))
            {
                MergeOption = MergeOption.OverwriteChanges,
                DisableInstanceAnnotationMaterialization = true
            };

            container.BuildingRequest += (s, e) =>
            {
                e.Headers.Add("PolicyKeys", this.PolicyKeys);
                e.Headers.Add("Authorization", Console.Program.SitecoreToken);
            };

            return(container);
        }
コード例 #6
0
        private static void GetPipelines(CommerceOps.Container container)
        {
            using (new SampleMethodScope())
            {
                var pipelineConfiguration = Proxy.GetValue(container.GetPipelines());

                var localPath = AppDomain.CurrentDomain.BaseDirectory;

                var pipelineFile = $"{localPath}/logs/ConfiguredPipelines.log";

                if (!Directory.Exists($"{localPath}/logs"))
                {
                    Directory.CreateDirectory($"{localPath}/logs");
                }

                if (File.Exists(pipelineFile))
                {
                    File.Delete(pipelineFile);
                }

                using (StreamWriter file =
                           new StreamWriter(pipelineFile))
                {
                    file.WriteLine("Current Pipeline Configuration");
                    file.WriteLine("-----------------------------------------------------------------");
                    foreach (var pipeline in pipelineConfiguration.List)
                    {
                        file.WriteLine($"{pipeline.Namespace}");
                        file.WriteLine($"{pipeline.Name} ({pipeline.Receives} => {pipeline.Returns})");
                        foreach (var block in pipeline.Blocks)
                        {
                            var computedNamespace = block.Namespace.Replace("Sitecore.Commerce.", "");
                            file.WriteLine(
                                $"     {computedNamespace}.{block.Name} ({block.Receives} => {block.Returns})");
                        }

                        if (!string.IsNullOrEmpty(pipeline.Comment))
                        {
                            file.WriteLine("     ------------------------------------------------------------");
                            file.WriteLine($"     Comment: {pipeline.Comment}");
                        }

                        file.WriteLine("-----------------------------------------------------------------");
                    }
                }
            }
        }
コード例 #7
0
        public CommerceOps.Container MinionsContainer()
        {
            var container = new CommerceOps.Container(new Uri(Program.MinionsServiceUri))
            {
                MergeOption = MergeOption.NoTracking,
                DisableInstanceAnnotationMaterialization = true
            };

            container.BuildingRequest += (s, e) =>
            {
                e.Headers.Add("PolicyKeys", PolicyKeys);
                e.Headers.Add("Environment", Environment);
                e.Headers.Add("Authorization", Program.SitecoreToken);
            };

            return(container);
        }