public static InspecJobRunner CreateJobRunner() { var commands = new FileSystemCommandsBoundary(); var fileSystem = new FileSystem(new EnvironmentBoundary(), commands); const string prefix = "inspec"; var product = prefix; return(new InspecJobRunner(StructureMapResolver.Container.GetInstance <JobRunner>(), CreateDownloadJob(fileSystem, product, prefix, "2012"), CreateInstallJob(product, fileSystem, commands, prefix, InstalledProductsFinder.IsInspec))); }
public static InstallJob CreateInstallJob(string product, FileSystem fileSystem, FileSystemCommandsBoundary commands, Func <ProductInstallationMetaData, bool> productMatcher, IDownloadUrlResolver downloadUrlResolver) { var chefProduct = new ChefProduct(product, new InstalledProductsFinder(), new ProductInstaller(fileSystem, new ProcessExecutor(() => new ProcessBoundary()), commands, $@"{ServerSettings.Instance.InstallRoot}\opscode", downloadUrlResolver), productMatcher); return(CreateInstallJob(chefProduct)); }
private static GenericProductJobRunner CreateJobRunner() { const string product = "cafe"; var commands = new FileSystemCommandsBoundary(); var fileSystem = new FileSystem(new EnvironmentBoundary(), commands); var resolver = new CafeDownloadUrlResolver(FindRuntimeIdentifier(commands)); var cafeInstaller = new CafeInstaller(commands, resolver, ServerSettings.Instance.UpdaterDirectory); return(new GenericProductJobRunner(StructureMapResolver.Container.GetInstance <JobRunner>(), InspecController.CreateDownloadJob(fileSystem, product, resolver), InspecController.CreateInstallJob(cafeInstaller))); }
private static ChefJobRunner CreateChefJobRunner() { var commands = new FileSystemCommandsBoundary(); var fileSystem = new FileSystem(new EnvironmentBoundary(), commands); const string prefix = "chef-client"; var product = "chef"; return(new ChefJobRunner(StructureMapResolver.Container.GetInstance <JobRunner>(), InspecController.CreateDownloadJob(fileSystem, product, prefix, "2012r2"), InspecController.CreateInstallJob(product, fileSystem, commands, prefix, InstalledProductsFinder.IsChefClient), StructureMapResolver.Container.GetInstance <RunChefJob>())); }
private static GenericProductJobRunner CreateJobRunner() { const string prefix = "inspec"; var downloadUrlResolver = new ChefDownloadUrlResolver(prefix, prefix, "2012"); var productName = prefix; var commands = new FileSystemCommandsBoundary(); var fileSystem = new FileSystem(new EnvironmentBoundary(), commands); return(new GenericProductJobRunner(StructureMapResolver.Container.GetInstance <JobRunner>(), CreateDownloadJob(fileSystem, productName, downloadUrlResolver), CreateInstallJob(productName, fileSystem, commands, InstalledProductsFinder.IsInspec, downloadUrlResolver))); }
private static OptionGroup CreateRunner(IClientFactory clientFactory) { var schedulerWaiter = new SchedulerWaiter(clientFactory.RestClientForJobServer, new AutoResetEventBoundary(), new TimerFactory(), new JobRunStatusPresenter(new PresenterMessagePresenter())); var processExecutor = new ProcessExecutor(() => new ProcessBoundary()); var environment = new EnvironmentBoundary(); var fileSystemCommands = new FileSystemCommandsBoundary(); var fileSystem = new FileSystem(environment, fileSystemCommands); var serviceStatusWaiter = new ServiceStatusWaiter("waiting for service status", new AutoResetEventBoundary(), new TimerFactory(), new ServiceStatusProvider(processExecutor, fileSystem)); // all options available var root = CreateRootGroup(clientFactory, schedulerWaiter, fileSystemCommands, processExecutor, fileSystem, serviceStatusWaiter, environment); Logger.Debug("Running application"); return(root); }