Esempio n. 1
0
        public JenkinsClient(JenkinsOptions options)
        {
            _options    = options;
            _httpClient = new HttpClient {
                BaseAddress = new Uri(options.JenkinsServerUri)
            };
            string basicAuthValue = Convert.ToBase64String(Encoding.GetEncoding("ISO-8859-1").GetBytes($"{options.UserName}:{options.UserToken}"));

            _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", basicAuthValue);
        }
        public static JenkinsOptions Current()
        {
            if (_current == null)
            {
                lock (LockObj)
                {
                    if (_current == null)
                    {
                        _current = Get();
                    }
                }
            }

            return(_current);
        }