Ejemplo n.º 1
0
        /// <summary>
        /// Build Index.
        /// </summary>
        public ActionResult Index()         // todo: create query def.
        {
            try
            {
                var model = new BuildManagerViewModel
                {
                    BuildQueryViewModel = new BuildQueryViewModel
                    {
                        ApiPath = Url.Action("GetBuildQueryViewModel", "Build")
                    }
                };
                return(View("Index", model));
            }
            catch (BaseException ex)
            {
                _logger.Log(ex);
            }
            catch (Exception ex)
            {
                _logger.Log(ex);
            }

            return(View("Error"));
        }
Ejemplo n.º 2
0
        private static int ExportBuilds(IBuildServer buildServer)
        {
            IBuildDefinition[] defs = buildServer.QueryBuildDefinitions(TeamProject);

            if (!Directory.Exists(ExportPath))
            {
                Console.WriteLine("ExportPath not found, creating: {0}", ExportPath);
                Directory.CreateDirectory(ExportPath);
            }

            Console.WriteLine("Exporting {0} definitions to: {1}", defs.Length, ExportPath);
            Console.WriteLine(string.Empty);

            foreach (var b in defs)
            {
                Console.WriteLine(b.Name);
                BuildManagerViewModel.ExportDefinition(new BuildDefinitionViewModel(b), ExportPath);
            }

            Console.WriteLine(string.Empty);
            Console.WriteLine("{0} definitions exported to: {1}", defs.Length, ExportPath);

            return(0);
        }