It's all about the answers!

Ask a question

Trigger a build if the SCM updated


Yuan Xu (1525) | asked Jun 03 '15, 2:52 a.m.
I know the schedule build can automatically build in RTC, but if I deliver the code in SCM, would it trigger a build immediately? how can i realize this?

Accepted answer


permanent link
sam detweiler (12.5k6195201) | answered Jun 03 '15, 8:01 a.m.
Please see the last two posts here
https://jazz.net/forum/questions/132739/jenkins-polling-is-too-slow-can-rtc-notify-jenkins-immediately

there are two extensions, like described by Ralph, that do provide triggering builds on deliver

One does JBE/ Build defs,
and mine supports a script where you can do whatever you want, ala git and SVN commit commit and post_receive hooks.
Yuan Xu selected this answer as the correct answer

One other answer



permanent link
Ralph Schoon (63.3k33646) | answered Jun 03 '15, 3:20 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jun 03 '15, 3:21 a.m.
No, it wouldn't. The JBE polls for build requests created by a schedule.

You would have to create a deliver follow up action similar to the Rational Team Concert Extensions Workshop you would work on the operation ID com.ibm.team.scm.server.deliver (Extension Points and Operation ID’s). I think you can reuse most of its code as well.

Restrict Delivery of Changesets Associated to Wrong Work Item Types Advisor  shows an Advisor for that operation (you want a participant), but it should give you some hints about the API as the same is used in advisors and participants.

To understand what you are up to, and how to get started you might want to read Setting up Rational Team Concert for API Development as well, it expands on the workshop content.

Comments
Yuan Xu commented Jun 03 '15, 4:14 a.m. | edited Jun 03 '15, 4:42 a.m.

Hi~ Ralph, thanks a lot for your answer.
and if I do not use the JBE (write a script for building),  so after I deliver the code and SCM has changed, is there a way to trigger my script running immediately ? is it possible to realize?


Ralph Schoon commented Jun 03 '15, 4:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Java allows to call the command line, so yes, that would be possible. Usually the build should be done on a build system in which case the server part of the participant has the means to connect to the build in the configuration. If you want to run the script locally, you would need to create a participant for com.ibm.team.scm.client.deliver deliver(client)  instead and it needs to be deployed in the client. The rest is very similar.

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.