Retrieve Build Log
Accepted answer
A later comment in the thread mentioned by Lauren shows how to get the internal ids for the build result and file contribution needed to form the URL. But since you're starting from Java, I assume you'd prefer to get the content via the Java client API, which would avoid having to reauthenticate, etc.
For log files (and other contributions with associated file content in the RTC repository), you can use:
com.ibm.team.build.common.model.IBuildResultContribution.getExtendedContributionData()
to get the content descriptor (an IContent).
To retrieve the contents given the IContent, use ITeamRepository.contentManager() then one of IContentManager's retrieve methods:
- com.ibm.team.repository.client.IContentManager.retrieveContent(IContent, OutputStream, IProgressMonitor)
- com.ibm.team.repository.client.IContentManager.retrieveContentStream(IContent, String, LineDelimiter, IProgressMonitor)
- com.ibm.team.repository.client.IContentManager.retrieveContentStream(IContent, IProgressMonitor)
2 other answers
Hi,
I found this forum post that should get you started: https://jazz.net/forum/questions/57724/fetch-build-log-from-an-ibuildresult-object
I found this forum post that should get you started: https://jazz.net/forum/questions/57724/fetch-build-log-from-an-ibuildresult-object
Comments
Yes the post mentioned has helped us to retrieve the log file name. But using the log file name how do I get to the log file content. As the post said, a typical log file URL is like this....
https://rtc01....../jazz/resource/virtual/build/result/_u11NsZ1VEeCO-eRZAbDMnQ/contribution/_CC5fgJ1WEeCO-eRZAbDMnQ/build-1308805236565.log
So the question now is how do I find the IDs before and after contrtibution.
So the question now is how do I find the IDs before and after contrtibution.
There's also the logRetriever Ant task (since 4.0), but it requires an exact file name to match. It would be better if we generalized this to support pattern matching. I have filed: Allow logRetriever and artifactFileRetriever Ant tasks to match against a file name pattern (272733)