Jenkins Build connected to RTC using JenkinsFile creates two build results when polled from Jenkins
Hello,
2 answers
//The following is a workaround for light checkout not working in RTC
Comments
I couldn't reproduce the issue with polling enabled either.
withCredentials([usernamePassword(credentialsId: '01c78c54-715c-4302-b68c-cfb7fb51f91a', passwordVariable: 'password', usernameVariable: 'userId')]) {
Thanks for your help It could possibly be something to do with a bit of latency in our network/ RTC, been a bit weird the last few weeks? It seems that if I fire a build from RTC it can sometimes take 15 minutes before it starts to run (the particular Jenkins instance is not doing anything, it is my test area), but if I run it from Jenkins it runs straight away.. I'm pretty sure the personal build clause is not running because I get the "Checking out snapshot in node message" in the console log. Using the skipDefaultCheckout option seems to cure my issue, I do prefer your solution to mine though.
Note that before I read your post, I was using the skipDefaultCheckout() option and running the whole thing in the script directory to get around the double checkout issue, might return to that idea, feels like a frig though. Any downside to this other than the ugliness?
Comments
I begin to think this is a better option than option 3
Hi Richard,
I'm using declarative syntax, which means I have to, I think, this is a Test Box, so master and slaves are one and the same. This is intended to run on a more complex system so I will need to allocate nodes at some point. Thanks for the information. I have settled on the skipDefaultCheckout workaround for now. I believe people creating a fresh jenkinsFile will mostly want to use declarative syntax.
The skipDefaultCheckout workaround works fine when you run it on the Master. I recently setup a slave system though and found that the files in the initial checkout to the @script directory did not make it to the Master, only the files in the second checkout made it
Comments
Sridevi Sangaiah
JAZZ DEVELOPER Jul 10 '19, 6:58 a.m.Richard Good
Jul 10 '19, 7:05 a.m.Approach 3, I believe the other ones are unavailable and under consideration for tool improvement. I am using a build definition and Team not personal build, so using a checkout with load rules to checkout just the directory containing the jenkinsFile and then a checkout of the snapshot created in that step.
Richard Good
Jul 15 '19, 4:20 a.m.Does anyone have a solution to this? The workaround is to not use a JenkinsFile, but that is annoying we want to config control the file itself. Can't see a way to avoid getting the two results.
Lakshmi Narasimhan T V
JAZZ DEVELOPER Jul 15 '19, 5:03 a.m.checkout([$class: 'RTCScm', buildType: [buildSnapshot: "${env.team_scm_snapshotUUID}", loadDirectory: 'C:\\Temp\\Test', value: 'buildSnapshot'], timeout: 480])
}