示例#1
0
        private void ExecuteOperation(Action <IOfferRemoteOperations, ServerConfig> remote, ServerConfig server)
        {
            var builder = new RemoteOperationsBuilder(server, _settings, _token);

            remote(builder, server);
            Result = builder.Result;
        }
示例#2
0
 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);
         }
     }
 }
示例#3
0
 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);
     }
 }
示例#4
0
 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);
 }
示例#5
0
 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);
                 }
             });
         }
     });
 }