Retrieve Build Log
I wanted to retrieve build log using JAVA API or Rest API. Can some one please suggest how to get this done.
|
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:
Praveen Kumar selected this answer as the correct answer
Comments
Praveen Kumar
commented Jul 18 '13, 4:48 a.m.
Thanks Egar
Praveen Kumar
commented Jul 18 '13, 4:49 a.m.
Sorry to spell you incorrectly. Thanks Edgar. |
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 Comments
Praveen Kumar
commented Jul 12 '13, 10:27 a.m.
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. |
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)
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.