public static TagInfo Create( string name, Tag model, string repoName, VariableHelper variableHelper, string buildContextPath = null) { TagInfo tagInfo = new TagInfo { Model = model, BuildContextPath = buildContextPath }; tagInfo.Name = variableHelper.SubstituteValues(name, tagInfo.GetVariableValue); tagInfo.FullyQualifiedName = GetFullyQualifiedName(repoName, tagInfo.Name); if (model.Syndication != null) { tagInfo.SyndicatedRepo = variableHelper.SubstituteValues(model.Syndication.Repo); tagInfo.SyndicatedDestinationTags = model.Syndication.DestinationTags? .Select(tag => variableHelper.SubstituteValues(tag)) .ToArray(); if (tagInfo.SyndicatedDestinationTags is null || !tagInfo.SyndicatedDestinationTags.Any()) { tagInfo.SyndicatedDestinationTags = new string[] { tagInfo.Name }; } } return(tagInfo); }
public static ImageInfo Create( Image model, string fullRepoModelName, string repoName, ManifestFilter manifestFilter, VariableHelper variableHelper, string baseDirectory) { ImageInfo imageInfo = new ImageInfo(); imageInfo.Model = model; imageInfo.ProductVersion = variableHelper.SubstituteValues(model.ProductVersion); if (model.SharedTags == null) { imageInfo.SharedTags = Enumerable.Empty <TagInfo>(); } else { imageInfo.SharedTags = model.SharedTags .Select(kvp => TagInfo.Create(kvp.Key, kvp.Value, repoName, variableHelper)) .ToArray(); } imageInfo.AllPlatforms = model.Platforms .Select(platform => PlatformInfo.Create(platform, fullRepoModelName, repoName, variableHelper, baseDirectory)) .ToArray(); IEnumerable <Platform> filteredPlatformModels = manifestFilter.GetPlatforms(model); imageInfo.FilteredPlatforms = imageInfo.AllPlatforms .Where(platform => filteredPlatformModels.Contains(platform.Model)); return(imageInfo); }
public static TagInfo Create( string name, Tag model, string repoName, VariableHelper variableHelper, string buildContextPath = null) { TagInfo tagInfo = new TagInfo(); tagInfo.Model = model; tagInfo.BuildContextPath = buildContextPath; tagInfo.Name = variableHelper.SubstituteValues(name, tagInfo.GetVariableValue); tagInfo.FullyQualifiedName = $"{repoName}:{tagInfo.Name}"; return(tagInfo); }