public DeployerCollection GrabServices(ILoggerInterface logger) { Dictionary <string, Type> serviceTypes = new Dictionary <string, Type>() { { "sqlsrv", typeof(Services.SQLService) }, { "disk", typeof(Services.DiskService) }, { "couchbase", typeof(Services.CouchbaseService) }, { "scheduler", typeof(Services.ScheduleService) } }; var services = new DeployerCollection(this.globalSettings, this, logger, this.parentInstalledApplicationSettings); foreach (var d in this.appSettings.getServices()) { var type = (string)d.Value["type"]; if (!serviceTypes.ContainsKey(type)) { throw new Exception("Service type not found:" + type); } Type serviceType = serviceTypes[type]; services.AddItem(serviceType, (JObject)d.Value); } return(services); }
/// <summary> /// Grab the deployers for an application /// </summary> /// <returns></returns> public DeployerCollection GrabDeployers(ILoggerInterface logger) { Dictionary <string, Type> deployerTypes = new Dictionary <string, Type>() { { "php", typeof(Php.PhpDeployer) }, { "iis", typeof(IIS.IISDeployer) }, { "app", typeof(Storage.AppBaseStorageDeployer) }, }; var deployers = new DeployerCollection(this.globalSettings, this, logger, this.parentInstalledApplicationSettings); foreach (var d in this.appSettings.getDeployers()) { var type = (string)d.Value["type"]; if (type == null || !deployerTypes.ContainsKey(type)) { throw new Exception($"Deployer type '{type}' not found."); } Type deployertype = deployerTypes[type]; deployers.AddItem(deployertype, (JObject)d.Value); } return(deployers); }