Clearcase integration with Jenkins to schedule jobs

1,111 views
Skip to first unread message

Vinod P

unread,
Jan 13, 2014, 10:49:51 PM1/13/14
to jenkins...@googlegroups.com
Hello all,

I am a newbie to Jenkins and Clearcase and have been going through the various options of Jenkins to facilitate CI.

However, I am not sure on how to configure Jenkins with UCM Clearcase in such a way that when a developer delivers his code to the Integration Stream in Clearcase (after having tested his code in the Development Stream where he makes changes to the code), Jenkins should start the build of the application.

In short, the requirement is that whenever any changes are delivered to the Integration stream in clearcase (UCM) , a build job should be automatically triggered in Jenkins.

Appreciate any help/guidance on this.

Regards
T.S

Slide

unread,
Jan 13, 2014, 11:08:49 PM1/13/14
to jenkins...@googlegroups.com
I think for the automatic triggering, you would need to implement a trigger in Clearcase that would initiate a build via URL. There really isn't a native way for Clearcase to notify Jenkins that someone delivered something, you would need to roll your own.

slide


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Website: http://earl-of-code.com

Palanilkunnathil Melemuriyil, Vinod P

unread,
Jan 14, 2014, 12:24:30 AM1/14/14
to jenkins...@googlegroups.com

Thanks Slide.

 

With the Clearcase plug-in installed in Jenkins, wouldn’t it be possible to poll SCM (i.e Clearcase) for any changes that are delivered to Integration Stream by the developers.

 

If any changes are found in Integration Stream then Jenkins runs the particular build job.

 

Regards

T.S

jes Struck

unread,
Jan 14, 2014, 4:27:10 AM1/14/14
to jenkins...@googlegroups.com
which where designed for exactly your work-flow.

This supports both poll when putting code to the integration stream but also if you create a baseline on you dev. stream you could poll that configuration and if build succeed push it too integration stream!...




Jes Struck
Consultant
Praqma A/S

Tel:+45 22 71 82 46

Mail: j...@praqma.net

web: www.praqma.net




Ng, Jeff

unread,
Jan 14, 2014, 4:22:56 PM1/14/14
to jenkins...@googlegroups.com

I have one of my UCM projects setup to do exactly what you are requesting.  Whenever a dev completes a delivery to the project integration stream, a “postop deliver_complete” trigger kicks off a build job using a URL (trigger builds remotely).  Here’s what you’ll need:

 

1.  Configure your Jenkins job to “Trigger builds remotely” (under Build Triggers).

   - I named my token “BUILD_AFTER_DELIVER_COMPLETE”.

 

2.  Make a ClearCase attribute used to enable or disable the automatic build triggering on a build stream.

   - Create the attribute type in the PVOB (I named mine “TriggerBuildAfterDelivery).

   - Scope:  ordinary

   - Enumeration values:  “ON”, “OFF”

   - Default value:  “ON”

   - Apply the attribute to any build stream that you wish to trigger a build.

 

3.  Make a UCM trigger type that fires after a delivery has been completed.

   - Create the trigger type in the PVOB (I named mine “JENKINS_BUILD_AFTER_DELIVERY”).

   - all UCM object trigger

   - post-op deliver_complete

   - Executes corresponding trigger script

 

4.  Write a trigger script, executed by the UCM trigger type, which constructs and executes the Jenkins URL.

   - I wrote mine in Perl and named it “jenkinsBuildAfterDelivery.tgr”.

   - My Jenkins build job name matches the name of the UCM stream being built (you’ll see why when you construct the URL).

   - If you use Perl, use the LWP::Simple module for the get() subroutine.

   - First get the value of the TriggerBuildAfterDelivery attribute (ct desc –s –attr $attr stream:$stream).

   - If the value == “ON”, construct your URL and `get` it.

   - Hint:  $jobName = $buildStream = $ENV{CLEARCASE_STREAM};

 

I also serialized UCM deliveries on these specific build streams to prevent multiple devs from delivering concurrently, thus interfering with the build triggering.  I’ll let you google for how to serialize UCM deliveries.  It’s easy and essentially requires the same things:  An attribute, a trigger type and a trigger script.

 

I’ve had this setup on my project for over a year now and it works great.

 

-Jeff Ng

--

Palanilkunnathil Melemuriyil, Vinod P

unread,
Jan 14, 2014, 10:33:57 PM1/14/14
to jenkins...@googlegroups.com

Thanks a lot Jeff for your valuable guidance.

 

Thank You

haritha swapna

unread,
Oct 27, 2016, 3:38:53 PM10/27/16
to Jenkins Users, jef...@lmco.com, deshraj sateesh

Hello Jeff,

Wow this is great !!!
Need your assistance on setting up this
!. Differences between Clear Case plugin, UCM CLear case & Base clear case.
2. what is that i need to put under config specin jenkins pipeline.

Have many queries any other way to contact you?
Reply all
Reply to author
Forward
0 new messages