private void ExecuteOperation(Action <IOfferRemoteOperations, ServerConfig> remote, ServerConfig server) { var builder = new RemoteOperationsBuilder(server, _settings, _token); remote(builder, server); Result = builder.Result; }
private static void ExecutePostOps(ConDepSettings conDepSettings, CancellationToken token) { foreach (var server in conDepSettings.Config.Servers) { //Todo: This will not work with ConDep server. After first run, this key will always exist. if (ConDepGlobals.ServersWithPreOps.ContainsKey(server.Name)) { var remotePostOps = new PostRemoteOps(); var dsl = new RemoteOperationsBuilder(server, conDepSettings, token); remotePostOps.Execute(dsl, server, conDepSettings, token); ConDepGlobals.ServersWithPreOps.Remove(server.Name); } } }
private void ConfigureAtrifact(IProvideArtifact artifact, ExecutionSequenceManager sequenceManager, ConDepSettings settings) { if (artifact is Artifact.Local) { var localSequence = sequenceManager.NewLocalSequence(artifact.GetType().Name); var localBuilder = new LocalOperationsBuilder(localSequence); ((Artifact.Local)artifact).Configure(localBuilder, settings); } else if (artifact is Artifact.Remote) { var remoteSequence = sequenceManager.NewRemoteSequence(artifact.GetType().Name); var remoteBuilder = new RemoteOperationsBuilder(remoteSequence); ((Artifact.Remote)artifact).Configure(remoteBuilder, settings); } }
private IOfferOperations ExecuteRemote(Action <IOfferRemoteOperations, ServerConfig> remote, IList <ServerConfig> servers) { foreach (var chunk in servers.Chunk(_serial)) { Task.Run(() => { foreach (var server in chunk) { var builder = new RemoteOperationsBuilder(server, _settings, _token); remote(builder, server); Result = builder.Result; } }, _token).Wait(_token); } return(this); }
public static void ExecutePreOps(ConDepSettings conDepSettings, CancellationToken token) { Logger.WithLogSection("Executing pre-operations", () => { foreach (var server in conDepSettings.Config.Servers) { Logger.WithLogSection(server.Name, () => { //Todo: This will not work with ConDep server. After first run, this key will always exist. if (!ConDepGlobals.ServersWithPreOps.ContainsKey(server.Name)) { var remotePreOps = new PreRemoteOps(new PowerShellExecutor()); var dsl = new RemoteOperationsBuilder(server, conDepSettings, token); remotePreOps.Execute(dsl, server, conDepSettings, token); ConDepGlobals.ServersWithPreOps.Add(server.Name, server); } }); } }); }