Skip to content

Commit

Permalink
feat(buildLog): adding build log hook (#904)
Browse files Browse the repository at this point in the history
  • Loading branch information
gal-yardeni committed Dec 1, 2020
1 parent 6d218d7 commit b0cd43f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,13 @@ List<GenericBuild> getBuilds(
String buildNumber,
String commitId,
String completionStatus);

/**
* Get the build log by providing the build id. The data returned will be used in the CI view, to
* present the build's log.
*
* @param buildId
* @return a string represent the build log
*/
String getBuildOutput(String buildId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
Expand All @@ -48,6 +49,11 @@ public List<GenericBuild> getBuilds(
return getCiService().getBuilds(projectKey, repoSlug, buildNumber, commitId, completionStatus);
}

@GetMapping("/builds/{buildId}/output")
public String getBuildOutput(@PathVariable(value = "buildId") String buildId) {
return getCiService().getBuildOutput(buildId);
}

private CiBuildService getCiService() {
if (ciBuildService.isPresent()) {
return ciBuildService.get();
Expand Down

0 comments on commit b0cd43f

Please sign in to comment.