It's all about the answers!

Ask a question

Environment variables in the Team Concert plugin for Jenkins


Rafael Rezende (431723) | asked May 27 '14, 1:41 p.m.
Hi,
I'm developing a plugin for Jenkins in which I need to use the information entered in the SCM section of the RTC plugin (for instance: User ID, Password file, Build Toolkit...).
As far as I know, the RTC plugin exposes the RTCBuildResultUUID, but I couldn't find a documentation about this and other variables.

So, what variables are exposed to the Jenkins environment? Is there any documentation about this?

Comments
Lily Wang commented May 28 '14, 3:45 a.m.

You can find the built-in build properties provided by JBE from https://jazz.net/help-dev/clm/index.jsp?re=1&topic=/com.ibm.team.concert.dotnet.doc/topics/r_build_prop.html&scope=null
I'm not sure if they all work in Jenkins.

Accepted answer


permanent link
Zoe Slattery (4011720) | answered May 28 '14, 4:16 a.m.
We are doing similar things. It's not very scientific but I just execeute 'env' in a Jenkins job that uses the TeamConcert plugin. This gets the list, and its fairly obvious what they are - but no documentation of course. However - I did fall over one oddity - there are both RTCBuildResultUUID and buidResultUUID, both have the same value if they are both set but under some circumstances the second one is not set. I think this happens when the Jenkins job is initiated by polling the SCM, if the job is initiated from RTC I get both values set.
Rafael Rezende selected this answer as the correct answer

Comments
Rafael Rezende commented May 28 '14, 4:40 a.m.

Not scientific, but solves the issue! In my case I executed set because the Jenkins server is running on a Windows machine. But you gave me the direction!

About your oddity, I have confirmed before that buildResultUUID is valid only if the request was started from the RTC client (including Personal builds). In this case, RTCBuildResultUUID will be assigned as buildResultUUID.
If the request started from Jenkins (i.e. by polling), the RTC plugin will generate the RTCBuildResultUUID on its own.
Also, the Console Output log will be reported back to RTC only if the request started from RTC. The buildResultUUID seems to be the reference between both sides.

I don't understand, however, how RTC is smart enough to catch a build result requested from outside, but not that smart to get the log file attached to it.
It's another story, anyway...
Thanks for the answer!


Zoe Slattery commented May 28 '14, 4:54 a.m.

Brilliant - and thanks so much for the info on the log not going back to RTC. That was my next issue to look at and you just fixed it for me :-) I think I can modify the Java code that I run at the end of the Jenkins job to send the log somewhere. I wonder if I can link it to the buildResult? hmmm.

Your answer


Register or to post 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.