Ejemplo n.º 1
0
        private void StartTask(DeploymentTask deploymentTask, Guid uniqueClientId, string requesterIdentity, Core.Domain.DeploymentInfo deploymentInfo)
        {
            var deploymentContext =
            new DeploymentContext(requesterIdentity);

              EventHandler<DiagnosticMessageEventArgs> deploymentPipelineDiagnosticMessageAction =
            (eventSender, tmpArgs) => LogMessage(uniqueClientId, tmpArgs.MessageType, tmpArgs.Message);

              try
              {
            _deploymentPipeline.DiagnosticMessagePosted += deploymentPipelineDiagnosticMessageAction;

            _deploymentPipeline.StartDeployment(deploymentInfo, deploymentTask, deploymentContext, _applicationConfiguration.DeployDependentProjects);
              }
              finally
              {
            _deploymentPipeline.DiagnosticMessagePosted -= deploymentPipelineDiagnosticMessageAction;
              }
        }
Ejemplo n.º 2
0
        private void StartTask(DeploymentTask deploymentTask, Guid uniqueClientId, string requesterIdentity, DeploymentInfo deploymentInfoDto, ProjectInfo projectInfo)
        {
            Core.Domain.DeploymentInfo deploymentInfo =
            DtoMapper.ConvertDeploymentInfo(deploymentInfoDto, projectInfo);

              var deploymentContext =
            new DeploymentContext(requesterIdentity);

              EventHandler<DiagnosticMessageEventArgs> deploymentPipelineDiagnosticMessageAction =
            (eventSender, tmpArgs) =>
            {
              _log.DebugIfEnabled(() => string.Format("{0}: {1}", tmpArgs.MessageType, tmpArgs.Message));

              _diagnosticMessagesLogger.LogMessage(uniqueClientId, tmpArgs.MessageType, tmpArgs.Message);
            };

              try
              {
            _deploymentPipeline.DiagnosticMessagePosted += deploymentPipelineDiagnosticMessageAction;

            _deploymentPipeline.StartDeployment(deploymentInfo, deploymentTask, deploymentContext);
              }
              finally
              {
            _deploymentPipeline.DiagnosticMessagePosted -= deploymentPipelineDiagnosticMessageAction;
              }
        }