Skip to content

Commit

Permalink
Fix Build-Info URL
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalb4doc committed Dec 28, 2024
1 parent 5b72f00 commit 39412aa
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@ public void runnerFinished(@NotNull BuildRunnerContext runner, @NotNull BuildFin
}

private static void addBuildInfoUrlParam(BuildRunnerContext runner) {
String artifactoryUrl = StringUtils.removeEnd((String)runner.getRunnerParameters().get("org.jfrog.artifactory.selectedDeployableServer.url"), "/");
String artifactoryUrl = StringUtils.removeEnd(runner.getRunnerParameters().get(RunnerParameterKeys.URL), "/");
String buildInfoUrl;
if (StringUtils.endsWith(artifactoryUrl, "/artifactory")) {
buildInfoUrl = createBuildInfoUrl(StringUtils.removeEnd(artifactoryUrl, "/artifactory"), (String)runner.getRunnerParameters().get("org.jfrog.artifactory.build.name"), runner.getBuild().getBuildNumber(), (String)runner.getRunnerParameters().get("org.jfrog.artifactory.build.timestamp"));
} else {
buildInfoUrl = BuildInfoExtractorUtils.createBuildInfoUrl(artifactoryUrl, (String)runner.getRunnerParameters().get("org.jfrog.artifactory.build.name"), runner.getBuild().getBuildNumber(), "", "", false, false);
// Without the platform URL it would work only on Artifactory 6
buildInfoUrl = BuildInfoExtractorUtils.createBuildInfoUrl(artifactoryUrl, runner.getRunnerParameters().get(BUILD_NAME),
runner.getBuild().getBuildNumber(), "", "", false, false);
}

runner.getBuild().addSharedSystemProperty("org.jfrog.artifactory.build.url." + runner.getBuild().getBuildId() + "." + runner.getId(), buildInfoUrl);
runner.getBuild().addSharedSystemProperty(BUILD_URL + "." + runner.getBuild().getBuildId() + "." + runner.getId(), buildInfoUrl);
}

private static String createBuildInfoUrl(String platformUrl, String buildName, String buildNumber, String timeStamp) {
Expand Down

0 comments on commit 39412aa

Please sign in to comment.