From aee94c82d2e7719d5c74e65a80f45239faa1ae6b Mon Sep 17 00:00:00 2001 From: Angelo Rodriguez Date: Fri, 24 Apr 2020 12:47:29 -0400 Subject: [PATCH] [INTG-199] Bamboo - CI/CD UX Redesign --- pom.xml | 3 +-- src/main/java/com/overops/plugins/bamboo/TaskType.java | 8 +++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 7e82d62..cda87b7 100644 --- a/pom.xml +++ b/pom.xml @@ -37,7 +37,6 @@ 1.8 2.33.0 - 2.32.0 @@ -104,7 +103,7 @@ com.takipi report-service - ${report.version} + ${takipi.version} diff --git a/src/main/java/com/overops/plugins/bamboo/TaskType.java b/src/main/java/com/overops/plugins/bamboo/TaskType.java index a58ffc2..0d7b0c1 100644 --- a/src/main/java/com/overops/plugins/bamboo/TaskType.java +++ b/src/main/java/com/overops/plugins/bamboo/TaskType.java @@ -1,10 +1,12 @@ package com.overops.plugins.bamboo; import java.io.PrintWriter; +import java.io.PrintStream; import java.io.StringWriter; import java.util.HashMap; import java.util.Map; + import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import com.atlassian.bamboo.build.logger.BuildLogger; @@ -23,6 +25,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.overops.plugins.bamboo.configuration.Const; +import com.overops.plugins.bamboo.service.impl.BambooPrintWriter; import com.overops.report.service.QualityReportParams; import com.overops.report.service.ReportService; import com.overops.report.service.ReportService.Requestor; @@ -70,7 +73,10 @@ public TaskResult execute(@NotNull TaskContext context) throws TaskException { try { logger.addBuildLogEntry("[" + Utils.getArtifactId() + " v" + Utils.getVersion() + "]"); - QualityReport reportModel = overOpsService.runQualityReport(endPoint, apiKey, query, Requestor.BAMBOO, logger, Boolean.parseBoolean(context.getConfigurationMap().get(Const.DEBUG))); + boolean isDebug = Boolean.parseBoolean(context.getConfigurationMap().get(Const.DEBUG)); + PrintStream printStream = isDebug ? new BambooPrintWriter(System.out, logger) : null; + + QualityReport reportModel = overOpsService.runQualityReport(endPoint, apiKey, query, Requestor.BAMBOO, printStream, isDebug); context.getBuildContext().getBuildResult().getCustomBuildData().put("overOpsReport", objectMapper.writeValueAsString(reportModel.getHtmlParts())); context.getBuildContext().getBuildResult().getCustomBuildData().put("isOverOpsStep", "true");