public override BuildMonitorViewModel GetModel() { var model = new BuildMonitorViewModel(); GetTeamCityBuildsJson(); foreach (var group in settings.Groups) { var project = new Project(); project.Name = group.Name; AddBuilds(ref project, group); model.Projects.Add(project); } return(model); }
public override BuildMonitorViewModel GetModel() { var model = new BuildMonitorViewModel(); GetTeamCityBuildsJson(); var count = (int)projectsJson.count; for (int i = 0; i < count; i++) { var project = new Project(); var projectJson = projectsJson.project[i]; project.Id = projectJson.id; project.Name = projectJson.name; AddBuilds(ref project); model.Projects.Add(project); } return(model); }
public async Task <BuildMonitorViewModel> GetModelAsync() { var model = new BuildMonitorViewModel(); foreach (var pipeline in _settings.Pipelines) { var overrideBuildStatus = BuildStatus.None; // is dev mode? if (_httpContextAccessor.HttpContext.Request.Host.Host.Contains("localhost") && pipeline.BuilderId == "Put a builder id here for testing") { overrideBuildStatus = _testModeLastStatus == BuildStatus.Success ? BuildStatus.Failure : BuildStatus.Success; _testModeLastStatus = overrideBuildStatus; } await HydratePipeline(pipeline, overrideBuildStatus); model.Pipelines.Add(pipeline); } return(model); }