RTC how to add a log file into a build result

872 Views Asked by At

So far I met all preconditions to perform a build, i have - a build user, a build repository workspace - a build server with a running build engine - a build definition (command line) and a lot of build results...

When my build is running it creates some extra information in a build.log file...

How can I attach that file from the build server to the build result after the build job is done? (well - it should be done at the end of the build job, not after the job is done). The file should be added by the build job and not be added manually...

build file would be here

i know it should be easy, but honestly - i'm stuck a bit, maybe even ashamed to ask such an trivial question...

3

There are 3 best solutions below

3
On BEST ANSWER

The easiest way to attach files to the RTC Build Result is by running the respective LogPublisher Ant Task.

You will need to provide an RTC Build Toolkit, available for Download from jazz.net, and pass it via command line (example below).

ant -lib /opt/rtc-build-toolkit/buildsystem/buildtoolkit

It will obviously require you to add this command to your build script (or Jenkins if it's the case). Either way, it's much more simple than programatically. RTC API has its tricks. Not fun. :-)

Just in case, IBM provides several other Ant Tasks for publishing stuff, see here.

6
On

The only hint that it could be possible to do this programmatically is in
"Add Log To Build Result".

The essence of it is in com.ibm.team.build.internal.publishing.AbstractContributionPublisher.publish(IBuildResultHandle, BuildStatus, ITeamRepository).

This isn't obvious though.

1
On

You have Add File... button on the right. Please try using it.