It's all about the answers!

Ask a question

Jazz Build Engine with GIT SCM

kathleen sharp (2821112) | asked Oct 01 '13, 12:47 p.m.
 I want to use a Jazz Build Engine to build source from GIT. Does anyone have any experience of doing this?

My current thought is to have a Build Workspace set up and clone the GIT repo to that at the start of every build, using jgit ant tasks, then build as normal (our other builds use RTC SCM).

Is this the recommended approach?

One answer

permanent link
Nick Edgar (6.5k711) | answered Oct 01 '13, 4:14 p.m.
Hi Kathleen, do your other builds do any modifications (delivering changes etc) back to RTC SCM?  If not, and it's just a question of getting the latest sources down to the build machine, I would not recommend trying to maintain the code in both SCM systems.

In the simplest case, you could create a command line or Ant build definition in RTC, configured to point to a script on the build machine whose first step uses the Git command line to bring in changes from Git.

If you want to maintain this script under version control, then you could create an RTC SCM stream and corresponding build workspace just for that, and include the Jazz Source Control option in the build definition to bring the script down to the build machine.

One limitation here is that there's no way for the RTC build to do a pre-build check for whether there are new changes in Git to build.  This check could be done early in your build script, and if no changes are found the script could invoke our completeTeamBuild Ant task with buildNotNecessary="true", which will close off the build and delete it.

Another option is to use Jenkins to run these Git builds, as it has good support for CI builds with Git.  With our Team Concert plugin for Jenkins, you could configure the job to refer to a corresponding build definition in RTC, and the plugin will take care of creating an RTC build result corresponding to the Jenkins build, and cross-linking them.  From within the main build script, you could still use our other Ant tasks for publishing downloads / logs / compilation- and test results, to the RTC build, like you do for regular JBE-based builds.

N. Dot commented Jun 21 '14, 10:16 p.m.

Hello Nick!  Now that RTC 5.0 has a native Git integration, are you able to create a build of the Git source code that is linked to an RTC work item via the Jenkins-RTC plugin?  If so, will the build results, in both RTC and Jenkins, reflect the RTC work items that were included in the build along with their associated change sets (which are in Git)?

Kiran M N commented Jun 23 '14, 3:18 a.m. | edited Jun 23 '14, 4:00 a.m.

@nessadot, RTC 5.0 has support for Git wrt process enforcement for push operation and linking work items with commits. There is no build related integration that has been udpated -- Jenkins RTC plugin included.

Nick Edgar commented Jun 23 '14, 10:11 a.m. | edited Jun 23 '14, 10:12 a.m.

The 5.0 Git integration's features are described here.

The 5.0.1 investigation on Git <-> Build integration is tracked by this plan item.
I suggest subscribing and posting your requirements there.

This doesn't specifically cover Jenkins integration, but since Git and Jenkins are often found in use together, the kind of scenario you describe makes perfect sense.

N. Dot commented Jun 23 '14, 5:39 p.m.
  1. Do you know if the Git integration that is provided by RLIA standard works any better in regard to supporting Git builds? 
  2. Also, what is the process that  should be followed to perform a Git build with Jenkins if you are using RTC 5.0?  In other words, 
    1. You use the RTC/Git integration to associate Git commits to RTC WIs.
    2. You create a Jenkins build script that will build Git source code.
    3. You use RTC to invoke the associated Jenkins build job.
  3. How will the RTC/Git change sets get reflected in build results in both RTC and Jenkins?

sam detweiler commented Jun 23 '14, 6:18 p.m.

another thing u can do is update the git commit trigger to fire a jenkins build

Push notification from repository

To minimize the delay between a push and a build, it is recommended to set up the post-receive hook in the repository to poke Jenkins when a new commit is made. To do this, add the following line in your hooks/post-receive where "URL of the Git repository" is the fully URL you use to clone this repository.

how that gets back to RTC without the RTC plugin being used I don't know

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.