diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2015-12-10 17:32:36 +0100 |
---|---|---|
committer | Duarte Meneses <duarte.meneses@sonarsource.com> | 2015-12-10 17:55:45 +0100 |
commit | 1be1ef656f02315135f1197f8dfa0128de3ab763 (patch) | |
tree | 7acbc70d1d0d5084f86e9ce1ab9366b9fb80b731 /sonar-batch/src | |
parent | da21079d404427b1195bf158acceb973fcdc5493 (diff) | |
download | sonarqube-1be1ef656f02315135f1197f8dfa0128de3ab763.tar.gz sonarqube-1be1ef656f02315135f1197f8dfa0128de3ab763.zip |
SONAR-6905 Batch should dump analysis-related URL into a properties file
Diffstat (limited to 'sonar-batch/src')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java | 3 | ||||
-rw-r--r-- | sonar-batch/src/test/java/org/sonar/batch/report/ReportPublisherTest.java | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java b/sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java index 2da734f8dde..1d9c4a81145 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java +++ b/sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java @@ -173,7 +173,8 @@ public class ReportPublisher implements Startable { Map<String, String> metadata = new LinkedHashMap<>(); String effectiveKey = projectReactor.getRoot().getKeyWithBranch(); metadata.put("projectKey", effectiveKey); - + metadata.put("serverUrl", publicUrl()); + URL dashboardUrl = HttpUrl.parse(publicUrl()).newBuilder() .addPathSegment("dashboard").addPathSegment("index").addPathSegment(effectiveKey) .build() diff --git a/sonar-batch/src/test/java/org/sonar/batch/report/ReportPublisherTest.java b/sonar-batch/src/test/java/org/sonar/batch/report/ReportPublisherTest.java index 576a2dcdf8a..04c1b4ff161 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/report/ReportPublisherTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/report/ReportPublisherTest.java @@ -81,6 +81,7 @@ public class ReportPublisherTest { File detailsFile = new File(temp.getRoot(), "report-task.txt"); assertThat(readFileToString(detailsFile)).isEqualTo( "projectKey=struts\n" + + "serverUrl=https://localhost/\n" + "dashboardUrl=https://localhost/dashboard/index/struts\n" + "ceTaskId=TASK-123\n" + "ceTaskUrl=https://localhost/api/ce/task?id=TASK-123\n" @@ -101,6 +102,7 @@ public class ReportPublisherTest { File detailsFile = new File(temp.getRoot(), "report-task.txt"); assertThat(readFileToString(detailsFile)).isEqualTo( "projectKey=struts\n" + + "serverUrl=https://publicserver/sonarqube/\n" + "dashboardUrl=https://publicserver/sonarqube/dashboard/index/struts\n" + "ceTaskId=TASK-123\n" + "ceTaskUrl=https://publicserver/sonarqube/api/ce/task?id=TASK-123\n" |