コード例 #1
0
ファイル: ApiCommand.cs プロジェクト: james-wu/Octopus-Tools
        protected ApiCommand(IOctopusRepositoryFactory repositoryFactory, ILog log)
        {
            this.repositoryFactory = repositoryFactory;
            this.log = log;

            var options = optionGroups.For("Common options");
            options.Add("server=", "The base URL for your Octopus server - e.g., http://your-octopus/", v => serverBaseUrl = v);
            options.Add("apiKey=", "Your API key. Get this from the user profile page.", v => apiKey = v);
            options.Add("user="******"[Optional] Username to use when authenticating with the server.", v => user = v);
            options.Add("pass="******"[Optional] Password to use when authenticating with the server.", v => pass = v);
            options.Add("configFile=", "[Optional] Text file of default values, with one 'key = value' per line.", v => ReadAdditionalInputsFromConfigurationFile(options, v));
            options.Add("debug", "[Optional] Enable debug logging", v => enableDebugging = true);
            options.Add("ignoreSslErrors", "[Optional] Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.", v => ignoreSslErrors = true);
            options.Add("enableServiceMessages", "[Optional] Enable TeamCity service messages when logging.", v => log.EnableServiceMessages());
        }
コード例 #2
0
        public OctopusSessionFactory(ILog log, ICommandLineArgsProvider commandLineArgsProvider)
        {
            this.log = log;

            var options = new OptionSet();
            options.Add("server=", "The base URL for your Octopus server - e.g., http://myserver/", v => serverBaseUrl = v);
            options.Add("user="******"[Optional] Username to use when authenticating with the server.", v => user = v);
            options.Add("pass="******"[Optional] Password to use when authenticating with the server.", v => pass = v);
            options.Add("apiKey=", "Your API key.", v => apiKey = v);
            options.Add("configFile=", "[Optional] Text file of default values, with one 'key = value' per line.", v => configFile = v);
            options.Add("enableservicemessages", "Enable TeamCity service messages", v => log.EnableServiceMessages());

            options.Parse(commandLineArgsProvider.Args);

            SetDefaultValuesFromConfigFile();
        }
コード例 #3
0
        protected ApiCommand(IOctopusSessionFactory client, ILog log)
        {
            this.client = client;
            this.log = log;

            options = new OptionSet
            {
                {"server=", "The base URL for your Octopus server - e.g., http://your-octopus/", v => serverBaseUrl = v},
                {"user="******"[Optional] Username to use when authenticating with the server.", v => user = v},
                {"pass=|password="******"[Optional] Password to use when authenticating with the server.", v => pass = v},
                {"apiKey=", "Your API key. Get this from the user profile page.", v => apiKey = v},
                {"configFile=", "[Optional] Text file of default values, with one 'key = value' per line.", v => ReadAdditionalInputsFromConfigurationFile(v)},
                {"debug", "[Optional] Enable debug logging", v => enableDebugging = true},
                {"ignoreSslErrors", "[Optional] Set this flag if your Octopus server uses HTTPS but the certificate is not trusted on this machine. Any certificate errors will be ignored. WARNING: this option may create a security vulnerability.", v => ignoreSslErrors = true},
                {"enableServiceMessages", "[Optional] Enable TeamCity service messages when logging.", v => log.EnableServiceMessages()}
            };
        }