Exemple #1
0
        private void WriteDeploymentRun(DeploymentRun deploymentRun)
        {
            _logger.LogInformation("Indexing begin deployment {0} {1}", deploymentRun.id, deploymentRun.DeploymentStatus);
            var response = _elasticClient.IndexDocument(deploymentRun);

            _logger.LogInformation("Indexing begin deployment {0} Result={1}", deploymentRun.id, response.Result);
        }
Exemple #2
0
        private void WriteDeployment(DeploymentRun deploymentRun)
        {
            _logger.LogInformation("Indexing deployment for {0}: {1}", deploymentRun.id, deploymentRun.Product.Name);
            var deployment = new DeploymentInstance()
            {
                id               = deploymentRun.Product.Name + "_" + deploymentRun.EnvironmentName,
                product          = deploymentRun.Product,
                environment      = deploymentRun.EnvironmentName,
                deploymentRunId  = deploymentRun.id,
                latestDeployment = DateTime.Now
            };
            var response = _elasticClient.IndexDocument(deployment);

            _logger.LogInformation("Indexing deployment for {0}: {1}", deploymentRun.id, response.Result);
        }
Exemple #3
0
        private void WriteLogEntry(DeploymentRun deploymentRun, string text, EntryType entryType)
        {
            _logger.LogInformation("Indexing {2} log for {0}: {1}", deploymentRun.id, text, entryType);
            var logEntry = new DeploymentLogEntry()
            {
                id = Guid.NewGuid(),
                DeploymentRunId = deploymentRun.id,
                Message         = text,
                MessageType     = entryType,
                Timestamp       = DateTime.Now
            };
            var response = _elasticClient.IndexDocument(logEntry);

            _logger.LogInformation("Indexing {2} log for {0}: Result={1}", deploymentRun.id, response.Result, entryType);
        }
Exemple #4
0
        private void WriteEvent(DeploymentRun deploymentRun, string text, EventType eventType)
        {
            _logger.LogInformation("Indexing {2} event for {0}: {1}", deploymentRun.id, text, eventType);
            var eventEntry = new DeploymentEvent()
            {
                id              = Guid.NewGuid(),
                DeploymentRun   = deploymentRun,
                DeploymentRunId = deploymentRun.id,
                Description     = text,
                EventType       = eventType,
                Timestamp       = DateTime.Now
            };
            var response = _elasticClient.IndexDocument(eventEntry);

            _logger.LogInformation("Indexing {2} log for {0}: Result={1}", deploymentRun.id, response.Result, eventType);
        }
Exemple #5
0
 public void EndDeploymentRun(DeploymentRun deploymentRun)
 {
     WriteDeploymentRun(deploymentRun);
     WriteEvent(deploymentRun, "Deployment Complete", EventType.Complete);
     WriteDeployment(deploymentRun);
 }
Exemple #6
0
 public void DeploymentRunInfo(DeploymentRun deploymentRun, string info)
 {
     WriteLogEntry(deploymentRun, info, EntryType.Info);
 }
Exemple #7
0
 public void DeploymentRunError(DeploymentRun deploymentRun, string error)
 {
     WriteLogEntry(deploymentRun, error, EntryType.Error);
 }
Exemple #8
0
 public void BeginDeploymentRun(DeploymentRun deploymentRun)
 {
     WriteDeploymentRun(deploymentRun);
     WriteEvent(deploymentRun, "Starting Deployment", EventType.Start);
 }