RTC/Jenkins integration - build only if there are source changes
SUNIL KUURAM (64●3●19●23)
| asked Feb 07 '13, 7:39 p.m.
edited Feb 27 '13, 11:56 a.m. by Spencer Murata (2.3k●11●59●71)
Hello Everyone,
I am trying to use RTC/Jenkins integration in RTC 4.0. Having setup a Jenkins engine, I am setting up a build definition with Jazz Source Control enabled. I have "Build only if changed accepted" checked and scheduled a build to run every 5 minutes. At this time, I would expect the build scheduler to look for changes and submit the build into Jenkins only if necessary. However the build definition triggers builds no matter what.
I have seen the expected behavior in RTC 3.0 with JBE. With Jazz Source Control enabled, you won't even see a build triggered unless there are source changes, avoids unnecessary cycles/build requests at the JBE.
This is a very useful feature, not sure why its dropped in Jenkins integration. Any ideas?
Thanks
Sunil
|
4 answers
You will still need to call the JBE from the Hudson build to use the Jazz SCM participant. The participant is just a bunch of data that the JBE happens to know how to interpret, however Hudson by itself does not know what to do with it.
There is an indepth article on this on the wiki:
https://jazz.net/wiki/bin/view/Main/JazzScmWithJenkins
~Spencer
Comments Can't the RTC engine/scheduler check if there were code changes? I would assume this would be a simple check to look at the build workspace, see if there are changes to accept and launch the build. This would really improve the performance of the build system avoiding unnecessary build cycles.
That is exactly the check that we are using in the wiki there. There aren't any unnecessary build cycles as we have to check at some point, and in the Wiki we are doing it from Jenkins.
SUNIL KUURAM
commented Mar 18 '13, 11:05 a.m.
I don't understand why the polling for source code changes should happen in Jenkins while all the required objects (RTC workspace, build definition, RTC stream, CI interval, include/exclude components, the config to "build only if source changes accepted") are all in RTC.
This is how most CI builds are deployed. Users generally do not want the CLM server to be tasked with determining if a build should be run or not since that activity will not scale well to larger deployments. Those several thousand build configurations would be processed every hour by the server greatly increasing load. Generally it is better to task the build system with determining if the build should proceed.
The developers will have to log into Jenkins regardless to configure their jobs. You could provide an Ant script as a library to handle the CI polling since it will be the same for all users, just with different parameters (stream, user, etc.)
~Spencer
|
As Sam stated above, the RTC/Jenkins integration that runs server-side doesn't know about SCM. Nor does our scheduler know about SCM (that would be a major design change). You need something in the Jenkins build to run the SCM phase, either via a Jenkins plugin or using a script calling out to our Ant tasks and/or JBE. The latter was the approach recommended in the above-mentioned wiki page.
Now that the new Jenkins plugin has been released, we recommend using that instead. If you configure the scheduling on the Jenkins side, continuous builds should be handled as you expect: it polls the server for changes, and only runs the build if changes are found.
and the referenced tutorial wiki page and video.
Comments Instead of polling either from RTC side or from Jenkins side, would be good to have Jenkins listen to changes in the RTC Stream and build immediately after noticing a new change. Like SubVersion Jenkins integration.
Davyd Norris
commented Feb 21 '19, 5:51 p.m.
See above - that's what it now does in the official Jenkins plugin
|
HI Sunil,
In Addition to Spencer\Nick's answers, Please find the blog for same requirements and let us know does it helps. Scheduled Jenkin Build Should run only if there are "changes accepted "https://www.ibm.com/developerworks/community/blogs/nfrsblog/entry/scheduled_jenkin_build_should_run_only_if_there_are_changes_accepted?lang=enRegards, Arun. |
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.
Comments
Hi Sunil,
Had any luck with this? I am trying to do the same thing.
Thanks !
Bernie