public async Task <IActionResult> PerformMassRelease()
        {
            var releaseController = new ReleaseController();
            var result            = ((ObjectResult)await releaseController.Get()).Value;
            var pipelines         = (List <IO.Swagger.Models.ReleaseInfo>)result;
            var fromEnv           = "SDTTEST";
            var toEnv             = "SDTUAT";

            return(new OkObjectResult("Disabled"));

            foreach (var pipeline in pipelines)
            {
                var fromEnvironment = pipeline.Environments.SingleOrDefault(x => x.Name == fromEnv);
                var toEnvironment   = pipeline.Environments.SingleOrDefault(x => x.Name == toEnv);

                if (pipeline.ProjectName == "Shared" || fromEnvironment == null || toEnvironment == null)
                {
                    continue;
                }

                await releaseController.PerformMassRelease("Enterprise%20Service%20Bus", fromEnvironment.ReleaseId, toEnvironment.DefinitionEnvironmentId);
            }

            return(new OkObjectResult($"Release from {fromEnv} to {toEnv} Triggered"));
        }
Beispiel #2
0
        public async Task <IActionResult> Index(string environment = null, int?definitionId = null)
        {
            var releaseController = new ReleaseController();
            var result            = (ObjectResult)await releaseController.Get(environment, definitionId);

            var dashboard = ToDashboard(result);

            Response.Headers.Add("Refresh", "30");
            return(View(dashboard));
        }
Beispiel #3
0
        public async void Get_Not_Exists()
        {
            ReleaseControllerMockFacade mock = new ReleaseControllerMockFacade();

            mock.ServiceMock.Setup(x => x.Get(It.IsAny <string>())).Returns(Task.FromResult <ApiReleaseResponseModel>(null));
            ReleaseController controller = new ReleaseController(mock.ApiSettingsMoc.Object, mock.LoggerMock.Object, mock.TransactionCoordinatorMock.Object, mock.ServiceMock.Object, mock.ModelMapperMock.Object);

            controller.ControllerContext             = new ControllerContext();
            controller.ControllerContext.HttpContext = new DefaultHttpContext();

            IActionResult response = await controller.Get(default(string));

            response.Should().BeOfType <StatusCodeResult>();
            (response as StatusCodeResult).StatusCode.Should().Be((int)HttpStatusCode.NotFound);
            mock.ServiceMock.Verify(x => x.Get(It.IsAny <string>()));
        }