Ejemplo n.º 1
0
        public void ShowUsers()
        {
            var users = _reader.GetUsers();

            foreach (var sharpUser in users)
            {
                var user = SharpMapper.ToUser(sharpUser, _reader.GetBuildsByUser(sharpUser.Username));
                _writer.Write(JsonConvert.SerializeObject(user));
            }
        }
Ejemplo n.º 2
0
        private static void UploadUsers(TeamCityReader reader)
        {
            var sharpUsers = reader.GetUsers();

            if ((sharpUsers == null) || (sharpUsers.Count < 1))
            {
                return;
            }

            Console.Write("Uploading {0} user records...", sharpUsers.Count);
            var users = sharpUsers
                        .Select(sharpUser =>
                                SharpMapper.ToUser(
                                    sharpUser,
                                    reader.GetBuildsByUser(sharpUser.Username)))
                        .ToList();

            new ElasticLoader(ElasticSearchAddress).UploadList(users, "teamcity_users", "User");
            Console.WriteLine();
        }