public void Run() { var confPath = Path.GetFullPath(string.Format("..{0}..{0}conf", Path.DirectorySeparatorChar)); ServerType[] servers; Product[] products; ProductEnvironment[] environments; var js = JsonSerializer.Create(); using (var reader = File.OpenText(Path.Combine(confPath, "servers.json"))) { servers = js.Deserialize <ServerType[]>(new JsonTextReader(reader)); } using (var reader = File.OpenText(Path.Combine(confPath, "products.json"))) { products = js.Deserialize <Product[]>(new JsonTextReader(reader)); } using (var reader = File.OpenText(Path.Combine(confPath, "envs.json"))) { environments = js.Deserialize <ProductEnvironment[]>(new JsonTextReader(reader)); } _logger.LogInformation("Staging Deployment Package"); var package = _packman.StorePackage(products[0], @"c:\temp\ea.zip"); _logger.LogInformation("Package stored: {0}", package.PackageID); _runner.Deploy(package, environments[0]); }
public IActionResult Post([FromBody] DeploymentRequest request) { var environment = _config.Environments.Where(e => e.Name == request.EnvironmentName).FirstOrDefault(); if (environment == null) { return(NotFound()); } var package = _packageManager.LoadPackage(request.PackageId); _deploymentRunner.Deploy(package, environment); return(Ok()); }