Beispiel #1
0
        public override void ParseCommandLine(ArgumentSyntax syntax)
        {
            base.ParseCommandLine(syntax);

            DefineManifestFilterOptions(syntax, this);

            string sourceRepoPrefix = null;

            syntax.DefineParameter("source-repo-prefix", ref sourceRepoPrefix, "Prefix of the source ACR repository to copy images from");
            SourceRepoPrefix = sourceRepoPrefix;

            string username = null;

            syntax.DefineParameter("username", ref username, "The URL or name associated with the service principal to use");
            Username = username;

            string password = null;

            syntax.DefineParameter("password", ref password, "The service principal password or the X509 certificate to use");
            Password = password;

            string tenant = null;

            syntax.DefineParameter("tenant", ref tenant, "The tenant associated with the service principal to use");
            Tenant = tenant;

            string subscription = null;

            syntax.DefineParameter("subscription", ref subscription, "Azure subscription to operate on");
            Subscription = subscription;
        }
Beispiel #2
0
        public override void DefineParameters(ArgumentSyntax syntax)
        {
            base.DefineParameters(syntax);

            string repoName = null;

            syntax.DefineParameter("repo", ref repoName, "Name of repo to target (wildcard chars * and ? supported)");
            RepoName = repoName;

            ServicePrincipal.DefineParameters(syntax);

            string subscription = null;

            syntax.DefineParameter("subscription", ref subscription, "Azure subscription to operate on");
            Subscription = subscription;

            string resourceGroup = null;

            syntax.DefineParameter("resource-group", ref resourceGroup, "Azure resource group to operate on");
            ResourceGroup = resourceGroup;

            string registryName = null;

            syntax.DefineParameter("registry", ref registryName, "Name of the registry");
            RegistryName = registryName;
        }
        public void DefineParameters(ArgumentSyntax syntax)
        {
            string accessToken = null;

            syntax.DefineParameter(
                "azdo-pat",
                ref accessToken,
                "Azure DevOps PAT");
            AccessToken = accessToken;

            string organization = null;

            syntax.DefineParameter(
                "azdo-org",
                ref organization,
                "Azure DevOps organization");
            Organization = organization;

            string project = null;

            syntax.DefineParameter(
                "azdo-project",
                ref project,
                "Azure DevOps project");
            Project = project;
        }
Beispiel #4
0
        public override void DefineParameters(ArgumentSyntax syntax)
        {
            base.DefineParameters(syntax);

            string buildPersonalAccessToken = null;

            syntax.DefineParameter(
                "build-pat",
                ref buildPersonalAccessToken,
                "Azure DevOps PAT for queuing builds");
            BuildPersonalAccessToken = buildPersonalAccessToken;

            string buildOrganization = null;

            syntax.DefineParameter(
                "build-organization",
                ref buildOrganization,
                "Azure DevOps organization for queuing builds");
            BuildOrganization = buildOrganization;

            string buildProject = null;

            syntax.DefineParameter(
                "build-project",
                ref buildProject,
                "Azure DevOps project for queuing builds");
            BuildProject = buildProject;
        }
Beispiel #5
0
        public override void ParseCommandLine(ArgumentSyntax syntax)
        {
            base.ParseCommandLine(syntax);

            string gitBranch = "master";

            syntax.DefineOption(
                "git-branch",
                ref gitBranch,
                "GitHub branch to write readmes to (defaults to master)");
            GitBranch = gitBranch;

            string gitOwner = "Microsoft";

            syntax.DefineOption(
                "git-owner",
                ref gitOwner,
                "Owner of the GitHub repo to write readmes to (defaults to Microsoft)");
            GitOwner = gitOwner;

            string gitPath = "teams";

            syntax.DefineOption(
                "git-path",
                ref gitPath,
                "Path within the GitHub repo to write readmes to (defaults to teams)");
            GitPath = gitPath;

            string gitRepo = "mcrdocs";

            syntax.DefineOption(
                "git-repo",
                ref gitRepo,
                "GitHub repo to readmes to (defaults to mcrdocs)");
            GitRepo = gitRepo;

            string gitUsername = null;

            syntax.DefineParameter(
                "git-username",
                ref gitUsername,
                "GitHub username");
            GitUsername = gitUsername;

            string gitEmail = null;

            syntax.DefineParameter(
                "git-email",
                ref gitEmail,
                "GitHub email");
            GitEmail = gitEmail;

            string gitAuthToken = null;

            syntax.DefineParameter(
                "git-auth-token",
                ref gitAuthToken,
                "GitHub authentication token");
            GitAuthToken = gitAuthToken;
        }
Beispiel #6
0
        public void DefineParameters(ArgumentSyntax syntax)
        {
            string username = null;

            syntax.DefineParameter(
                "git-username",
                ref username,
                "GitHub username");
            Username = username;

            string email = null;

            syntax.DefineParameter(
                "git-email",
                ref email,
                "GitHub email");
            Email = email;

            string authToken = null;

            syntax.DefineParameter(
                "git-auth-token",
                ref authToken,
                "GitHub authentication token");
            AuthToken = authToken;
        }
Beispiel #7
0
        public override void DefineParameters(ArgumentSyntax syntax)
        {
            base.DefineParameters(syntax);

            ServicePrincipal.DefineParameters(syntax);

            string subscription = null;

            syntax.DefineParameter("subscription", ref subscription, "Azure subscription to operate on");
            Subscription = subscription;

            string resourceGroup = null;

            syntax.DefineParameter("resource-group", ref resourceGroup, "Azure resource group to operate on");
            ResourceGroup = resourceGroup;
        }
Beispiel #8
0
        public override void ParseCommandLine(ArgumentSyntax syntax)
        {
            base.ParseCommandLine(syntax);

            string readmePath = null;

            syntax.DefineOption("readme-path", ref readmePath, "Path of the readme to update (defaults to manifest setting)");
            ReadmePath = readmePath;

            bool skipValidation = false;

            syntax.DefineOption(
                "skip-validation", ref skipValidation, "Skip validating all documented tags are included in the readme");
            SkipValidation = skipValidation;

            bool updateReadme = false;

            syntax.DefineOption("update-readme", ref updateReadme, "Update the readme file");
            UpdateReadme = updateReadme;

            string template = null;

            syntax.DefineOption("template", ref template, "Path to a custom template file");
            Template = template;

            string sourceUrl = null;

            syntax.DefineParameter("source-url", ref sourceUrl, "Base URL of the Dockerfile sources");
            SourceUrl = sourceUrl;
        }
Beispiel #9
0
        public override void ParseCommandLine(ArgumentSyntax syntax)
        {
            base.ParseCommandLine(syntax);

            FilterOptions.ParseCommandLine(syntax);

            int allowedVariance = 5;

            syntax.DefineOption("variance", ref allowedVariance, $"Allowed percent variance in size (default is `{allowedVariance}`");
            AllowedVariance = allowedVariance;

            bool isPullEnabled = false;

            syntax.DefineOption("pull", ref isPullEnabled, "Pull the images vs using local images");
            IsPullEnabled = isPullEnabled;

            bool updateBaseline = false;

            syntax.DefineOption("update", ref updateBaseline, "Update the baseline file (default is false)");
            UpdateBaseline = updateBaseline;

            string baselinePath = null;

            syntax.DefineParameter("baseline", ref baselinePath, "Path to the baseline file");
            BaselinePath = baselinePath;
        }
 public static ArgumentSyntax DefineParameter(
     this ArgumentSyntax syntax, string name, string help = null)
 {
     var arg = syntax.DefineParameter(name, null);
     arg.Help = help;
     return syntax;
 }
Beispiel #11
0
 protected override void Define(ArgumentSyntax syntax, Settings settings)
 {
     if (!syntax.DefineParameter("assembly", ref settings.Assembly, "The assembly to load by name.").IsSpecified)
     {
         syntax.ReportError("an assembly name must be specified.");
     }
 }
Beispiel #12
0
        public void DefineParameters(ArgumentSyntax syntax)
        {
            string username = null;

            syntax.DefineParameter("client-id", ref username, "Client ID of service principal");
            ClientId = username;

            string password = null;

            syntax.DefineParameter("secret", ref password, "Secret of service principal");
            Secret = password;

            string tenant = null;

            syntax.DefineParameter("tenant", ref tenant, "Tenant of service principal");
            Tenant = tenant;
        }
        public static ArgumentSyntax DefineUriParameter(
            this ArgumentSyntax syntax, string name, string help = null)
        {
            var arg = syntax.DefineParameter(name, null, s => new Uri(s));

            arg.Help = help;
            return(syntax);
        }
Beispiel #14
0
 protected override void Define(ArgumentSyntax syntax, Settings settings)
 {
     syntax.DefineOption("i|ignore-known-packages", ref settings.IgnoreKnownPackages, "Ignores (does not add) packages for known themes.");
     if (!syntax.DefineParameter("theme", ref settings.Theme, "The theme to use.").IsSpecified)
     {
         syntax.ReportError("a theme must be specified.");
     }
 }
        public override void DefineParameters(ArgumentSyntax syntax)
        {
            base.DefineParameters(syntax);

            string baselinePath = null;

            syntax.DefineParameter("baseline", ref baselinePath, "Path to the baseline file");
            BaselinePath = baselinePath;
        }
Beispiel #16
0
        public override void ParseCommandLine(ArgumentSyntax syntax)
        {
            base.ParseCommandLine(syntax);

            string   sourceUrl    = null;
            Argument sourceUrlArg = syntax.DefineParameter("source-url", ref sourceUrl, "Base URL of the Dockerfile sources");

            SourceUrl = sourceUrl;
        }
Beispiel #17
0
        public override void DefineParameters(ArgumentSyntax syntax)
        {
            base.DefineParameters(syntax);

            string imageInfoPath = null;

            syntax.DefineParameter("image-info-path", ref imageInfoPath, "Image info file path");
            ImageInfoPath = imageInfoPath;
        }
Beispiel #18
0
        public override void DefineParameters(ArgumentSyntax syntax)
        {
            base.DefineParameters(syntax);

            string outputPath = null;

            syntax.DefineParameter("output-path", ref outputPath, "The path to write the graph to");
            OutputPath = outputPath;
        }
Beispiel #19
0
        public override void DefineParameters(ArgumentSyntax syntax)
        {
            base.DefineParameters(syntax);

            string sourceRepoPrefix = null;

            syntax.DefineParameter("source-repo-prefix", ref sourceRepoPrefix, "Prefix of the source ACR repository to copy images from");
            SourceRepoPrefix = sourceRepoPrefix;
        }
        public override void DefineParameters(ArgumentSyntax syntax)
        {
            base.DefineParameters(syntax);

            string sourceRepoUrl = null;

            syntax.DefineParameter("source-repo", ref sourceRepoUrl, "Repo URL of the Dockerfile sources");
            SourceRepoUrl = sourceRepoUrl;
        }
Beispiel #21
0
        public override void DefineParameters(ArgumentSyntax syntax)
        {
            base.DefineParameters(syntax);

            string commitDigest = null;

            syntax.DefineParameter("commit-digest", ref commitDigest, "Git commit digest of the readme changes");
            CommitDigest = commitDigest;

            ServicePrincipal.DefineParameters(syntax);
        }
        public override void DefineParameters(ArgumentSyntax syntax)
        {
            base.DefineParameters(syntax);

            string imageInfoPath = null;

            syntax.DefineParameter("image-info", ref imageInfoPath, "Path to image info file");
            ImageInfoPath = imageInfoPath;

            ServicePrincipal.DefineParameters(syntax);
        }
        public override void DefineParameters(ArgumentSyntax syntax)
        {
            base.DefineParameters(syntax);

            string sourceImageInfoFolderPath = null;

            syntax.DefineParameter(
                "source-path",
                ref sourceImageInfoFolderPath,
                "Folder path containing image info files");
            SourceImageInfoFolderPath = sourceImageInfoFolderPath;

            string destinationPath = null;

            syntax.DefineParameter(
                "destination-path",
                ref destinationPath,
                "Path to store the merged image info content");
            DestinationImageInfoPath = destinationPath;
        }
Beispiel #24
0
        public override void DefineParameters(ArgumentSyntax syntax)
        {
            base.DefineParameters(syntax);

            string sourceRepoPrefix = null;

            syntax.DefineParameter("source-repo-prefix", ref sourceRepoPrefix, "Prefix of the source ACR repository to copy images from");
            SourceRepoPrefix = sourceRepoPrefix;

            ServicePrincipal.DefineParameters(syntax);

            string subscription = null;

            syntax.DefineParameter("subscription", ref subscription, "Azure subscription to operate on");
            Subscription = subscription;

            string resourceGroup = null;

            syntax.DefineParameter("resource-group", ref resourceGroup, "Azure resource group to operate on");
            ResourceGroup = resourceGroup;
        }
Beispiel #25
0
        public override void DefineParameters(ArgumentSyntax syntax)
        {
            base.DefineParameters(syntax);

            string cluster = null;

            syntax.DefineParameter("cluster", ref cluster, "The cluster to ingest the data to");
            Cluster = cluster;

            string database = null;

            syntax.DefineParameter("database", ref database, "The database to ingest the data to");
            Database = database;

            string table = null;

            syntax.DefineParameter("table", ref table, "The table to ingest the data to");
            Table = table;

            ServicePrincipal.DefineParameters(syntax);
        }
        public override void DefineParameters(ArgumentSyntax syntax)
        {
            base.DefineParameters(syntax);

            string cluster = null;

            syntax.DefineParameter("cluster", ref cluster, "The cluster to ingest the data to");
            Cluster = cluster;

            string database = null;

            syntax.DefineParameter("database", ref database, "The database to ingest the data to");
            Database = database;

            string table = null;

            syntax.DefineParameter("table", ref table, "The table to ingest the data to");
            Table = table;

            string clientID = null;

            syntax.DefineParameter("client-id", ref clientID, "The URL or name associated with the service principal");
            ClientID = clientID;

            string secret = null;

            syntax.DefineParameter("secret", ref secret, "The service principal password");
            Secret = secret;

            string tenant = null;

            syntax.DefineParameter("tenant", ref tenant, "The tenant associated with the service principal");
            Tenant = tenant;
        }
        public override void DefineParameters(ArgumentSyntax syntax)
        {
            base.DefineParameters(syntax);

            string sourceRepoPrefix = null;

            syntax.DefineParameter("source-repo-prefix", ref sourceRepoPrefix, "Prefix of the source ACR repository to copy images from");
            SourceRepoPrefix = sourceRepoPrefix;

            string username = null;

            syntax.DefineParameter("username", ref username, "The URL or name associated with the service principal to use");
            Username = username;

            string password = null;

            syntax.DefineParameter("password", ref password, "The service principal password or the X509 certificate to use");
            Password = password;

            string tenant = null;

            syntax.DefineParameter("tenant", ref tenant, "The tenant associated with the service principal to use");
            Tenant = tenant;

            string subscription = null;

            syntax.DefineParameter("subscription", ref subscription, "Azure subscription to operate on");
            Subscription = subscription;

            string resourceGroup = null;

            syntax.DefineParameter("resource-group", ref resourceGroup, "Azure resource group to operate on");
            ResourceGroup = resourceGroup;
        }
        public override void DefineParameters(ArgumentSyntax syntax)
        {
            base.DefineParameters(syntax);

            GitOptions.DefineParameters(syntax);

            string variableName = null;

            syntax.DefineParameter(
                "image-paths-variable",
                ref variableName,
                "The Azure Pipeline variable name to assign the image paths to");
            VariableName = variableName;
        }
Beispiel #29
0
        public override void ParseCommandLine(ArgumentSyntax syntax)
        {
            base.ParseCommandLine(syntax);

            bool updateReadme = false;

            syntax.DefineOption("update-readme", ref updateReadme, "Update the readme file");
            UpdateReadme = updateReadme;

            string template = null;

            syntax.DefineOption("template", ref template, "Path to a custom template file");
            Template = template;

            string sourceUrl = null;

            syntax.DefineParameter("source-url", ref sourceUrl, "Base URL of the Dockerfile sources");
            SourceUrl = sourceUrl;
        }
Beispiel #30
0
 protected override void Define(ArgumentSyntax syntax, Settings settings)
 {
     syntax.DefineOption("p|prerelease", ref settings.Prerelease, "Specifies that prerelease packages are allowed.");
     syntax.DefineOption("u|unlisted", ref settings.Unlisted, "Specifies that unlisted packages are allowed.");
     syntax.DefineOption("v|version", ref settings.VersionRange, "Specifies the version range of the package to use.");
     if (syntax.DefineOption("l|latest", ref settings.Latest, "Specifies that the latest available version of the package should be used (this will always trigger a request to the sources).").IsSpecified &&
         !string.IsNullOrEmpty(settings.VersionRange))
     {
         syntax.ReportError("latest cannot be specified if a version range is specified.");
     }
     syntax.DefineOptionList("s|source", ref settings.Sources, "Specifies the package source(s) to get the package from.");
     if (syntax.DefineOption("e|exclusive", ref settings.Exclusive, "Indicates that only the specified package source(s) should be used to find the package.").IsSpecified &&
         settings.Sources == null)
     {
         syntax.ReportError("exclusive can only be used if sources are specified.");
     }
     if (!syntax.DefineParameter("package", ref settings.Package, "The package to install.").IsSpecified)
     {
         syntax.ReportError("a package must be specified.");
     }
 }
Beispiel #31
0
 protected override void ParseParameters(ArgumentSyntax syntax)
 {
     syntax.DefineParameter("path", ref _path, DirectoryPath.FromString, "The path that the server should preview (defaults to \"output\").");
 }
Beispiel #32
0
 protected override void ParseParameters(ArgumentSyntax syntax)
 {
     syntax.DefineParameter("path", ref _path, DirectoryPath.FromString, "The path to generate the scaffold in.");
 }
Beispiel #33
0
 protected override void ParseParameters(ArgumentSyntax syntax)
 {
     // Root
     if (syntax.DefineParameter("root", ref _configOptions.RootPath, DirectoryPath.FromString, "The folder (or config file) to use.").IsSpecified)
     {
         // If a root folder was defined, but it actually points to a file, set the root folder to the directory
         // and use the specified file as the config file (if a config file was already specified, it's an error)
         FilePath rootDirectoryPathAsConfigFile = new DirectoryPath(Environment.CurrentDirectory).CombineFile(_configOptions.RootPath.FullPath);
         if (File.Exists(rootDirectoryPathAsConfigFile.FullPath))
         {
             // The specified root actually points to a file...
             if (_configOptions.ConfigFilePath != null)
             {
                 syntax.ReportError("A config file was both explicitly specified and specified in the root folder.");
             }
             else
             {
                 _configOptions.ConfigFilePath = rootDirectoryPathAsConfigFile.FileName;
                 _configOptions.RootPath = rootDirectoryPathAsConfigFile.Directory;
             }
         }
     }
 }