Exemple #1
0
        protected static void DefineManifestFilterOptions(ArgumentSyntax syntax, IManifestFilterOptions filterOptions)
        {
            string architecture = DockerHelper.Architecture.ToString().ToLowerInvariant();

            syntax.DefineOption(
                "architecture",
                ref architecture,
                "Architecture of Dockerfiles to operate on - wildcard chars * and ? supported (default is current OS architecture)");
            filterOptions.Architecture = architecture;

            string osType = DockerHelper.OS.ToString().ToLowerInvariant();

            syntax.DefineOption(
                "os-type",
                ref osType,
                "OS type (linux/windows) of the Dockerfiles to build - wildcard chars * and ? supported (default is the Docker OS)");
            filterOptions.OsType = osType;

            string osVersion = null;

            syntax.DefineOption(
                "os-version",
                ref osVersion,
                "OS version of the Dockerfiles to build - wildcard chars * and ? supported (default is to build all)");
            filterOptions.OsVersion = osVersion;

            IReadOnlyList <string> paths = Array.Empty <string>();

            syntax.DefineOptionList(
                "path",
                ref paths,
                "Directory paths containing the Dockerfiles to build - wildcard chars * and ? supported (default is to build all)");
            filterOptions.Paths = paths;
        }
Exemple #2
0
        public virtual ManifestFilter GetManifestFilter()
        {
            ManifestFilter filter = new ManifestFilter()
            {
                IncludeRepo = Repo,
            };

            if (this is IManifestFilterOptions)
            {
                IManifestFilterOptions filterOptions = (IManifestFilterOptions)this;
                filter.DockerArchitecture = filterOptions.Architecture;
                filter.IncludeOsVersion   = filterOptions.OsVersion;
                filter.IncludePaths       = filterOptions.Paths;
            }

            return(filter);
        }
Exemple #3
0
        protected static void DefineManifestFilterOptions(ArgumentSyntax syntax, IManifestFilterOptions filterOptions)
        {
            filterOptions.Architecture = DefineArchitectureOption(syntax);

            string osVersion = null;

            syntax.DefineOption(
                "os-version",
                ref osVersion,
                "OS version of the Dockerfiles to build - wildcard chars * and ? supported (default is to build all)");
            filterOptions.OsVersion = osVersion;

            IReadOnlyList <string> paths = Array.Empty <string>();

            syntax.DefineOptionList(
                "path",
                ref paths,
                "Directory paths containing the Dockerfiles to build - wildcard chars * and ? supported (default is to build all)");
            filterOptions.Paths = paths;
        }