Publish a snapshot back to a RTC build result from a Jenkins build job
I am trying to publish a specific snapshot to a RTC build result. The build setup we use is as follows. We use Jenkins 2.x with Pipeline build scripts (pipeline script from scm). And the way we interact with builds is through build definitions setup in RTC (so developers submit build requests in RTC). The RTC build definition is pretty simple and just connects to a corresponding Jenkins build job. And as already mentioned the Jenkins build job uses a Pipeline build script from SCM.
Library('dcbldlib') _
checkout([$class: jazz.class, avoidUsingToolkit: jazz.toolkit, buildTool: jazz.tool, buildType: [buildStream: 'stream name', clearLoadDirectory: false, customizedSnapshotName: props.snapshotName, loadDirectory: props.loadDir, overrideDefaultSnapshotName: true, value: 'buildStream'], credentialsId: 'jenkins-creds-id', overrideGlobal: jazz.override, serverURI: jazz.uri, timeout: jazz.timeout])
3 answers
I would suggest to contact support and maybe open an enhancement request. It might be possible to achieve what you want using the API, however it would be nice if it was supported in the Jenkins Build.
Comments
Since you should be able to publish arbitrary build results back to RTC, can't you just publish the snapshot URL back to RTC as one of your build results? (A file containing that snapshot URL string, for example). It won't show up nicely in the GUI in the RTC build result, but the information would be there for you to use.
Comments
For some reason I cannot comment directly under your question or any of the answers. So, please don't take this as an answer :-)
I'm afraid I will fall into the same issue very soon, so I would like to know more about your configuration. I'm missing just few details on how you are checking out the Global Shared Libs and the Jenkins pipeline script.
This is how I would compose my environment...
Principles:
A - The tools around the build environment are "static". I don't want to get the latest state, I want a proven groovy code that handle/build my target project. Therefore, these tools are loaded from Snapshots.
B - The target project should be in its latest state. Therefore, Stream, RW or Build Definition (which in turn loads a RW).
Based on that,
1 - the Global Shared Libs are part of A, being loaded from a Snapshot.
2 - the Jenkins pipeline script is also part of A, loaded from a(nother) Snapshot.
3 - the actual project (B) is loaded using the Build Definition.
I would expect the Build Results for this configuration to contain a link to the corresponding checkout. That is, the Jenkins pipeline script (2) uses the Global Shared Libs (1) and triggers the checkout (3) using the Build Definition.
The last checkout is the one that creates the Build Result, so I would find very strange and counter-intuitive to have any Snapshot other than the one from (3).
Do you have a similar configuration?
If yes, which Snapshot do you see in your Build Result? 1, 2 or 3?
Would you have a Work Item number to share? I would happily vote on that.
Update: I'm able to convert the answer into Comment after posting it. Strange UX imho.
Update2: I can't edit a Comment after converting it from Answer. It has the "edit" button, but it pops a plain HTML page instead. Looks like bug.
Update3: I had to convert it back to Answer to be able to update the message. But now I'm unable to convert it to Comment again. Looks like another bug... The message will have to stay as "answer".
Comments
Rob Leach
Aug 23 '17, 3:24 p.m.Rob Leach
Sep 06 '17, 1:56 p.m.Rob Leach
Oct 25 '17, 3:18 p.m.Rob Leach
Dec 06 '17, 1:15 p.m.Lakshmi Narasimhan T V
JAZZ DEVELOPER Dec 07 '17, 11:29 a.m.