private void AddDockerfilePathLegs(
            MatrixInfo matrix, IEnumerable <string> matrixNameParts, IGrouping <PlatformId, PlatformInfo> platformGrouping)
        {
            IEnumerable <string> platformNameParts = new string[] {
                platformGrouping.Key.OsVersion ?? platformGrouping.Key.OS.GetDockerName(),
                platformGrouping.Key.Architecture.GetDockerName(),
            };

            IEnumerable <IEnumerable <PlatformInfo> > subgraphs = platformGrouping.GetCompleteSubgraphs(GetPlatformDependencies);

            foreach (IEnumerable <PlatformInfo> subgraph in subgraphs)
            {
                string[] dockerfilePaths = GetDockerfilePaths(subgraph)
                                           .Union(GetCustomLegGroupingDockerfilePaths(subgraph))
                                           .ToArray();

                LegInfo leg = new LegInfo()
                {
                    Name = GetDockerfilePathLegName(dockerfilePaths, platformNameParts, matrixNameParts)
                };
                matrix.Legs.Add(leg);

                AddImageBuilderPathsVariable(dockerfilePaths, leg);
                AddPlatformVariables(platformGrouping, leg);
            }
        }
Ejemplo n.º 2
0
        private void AddBuildLegs(MatrixInfo matrix, string[] matrixNameParts, IGrouping <dynamic, PlatformInfo> platformGrouping)
        {
            IEnumerable <IEnumerable <PlatformInfo> > subgraphs = platformGrouping.GetCompleteSubgraphs(GetPlatformDependencies);

            foreach (IEnumerable <PlatformInfo> subgraph in subgraphs)
            {
                string[] dockerfilePaths = subgraph
                                           .Select(platform => platform.Model.Dockerfile)
                                           .ToArray();
                LegInfo leg = new LegInfo()
                {
                    Name = FormatLegName(dockerfilePaths, matrixNameParts)
                };
                matrix.Legs.Add(leg);

                string pathArgs = dockerfilePaths
                                  .Select(path => $"--path {path}")
                                  .Aggregate((working, next) => $"{working} {next}");
                leg.Variables.Add(("imageBuilderPaths", pathArgs));
            }
        }
        private void AddDockerfilePathLegs(
            BuildMatrixInfo matrix, IEnumerable <string> matrixNameParts, IGrouping <PlatformId, PlatformInfo> platformGrouping)
        {
            IEnumerable <IEnumerable <PlatformInfo> > subgraphs = platformGrouping.GetCompleteSubgraphs(
                platform => GetPlatformDependencies(platform, platformGrouping));

            foreach (IEnumerable <PlatformInfo> subgraph in subgraphs)
            {
                string[] dockerfilePaths = GetDockerfilePaths(subgraph)
                                           .Union(GetCustomLegGroupingDockerfilePaths(subgraph))
                                           .ToArray();

                BuildLegInfo leg = new BuildLegInfo()
                {
                    Name = GetDockerfilePathLegName(dockerfilePaths, matrixNameParts)
                };
                matrix.Legs.Add(leg);

                AddImageBuilderPathsVariable(dockerfilePaths, leg);
                AddCommonVariables(platformGrouping, leg);
            }
        }