2

I currently have a CI environment setup using the following tools:

VCS - ClearCase (UCM enabled)
CI Server - Jenkins
Build Engine - MSBuild

Basically Jenkins is polling my UCM Project's Integration stream every 2 minutes and building via a msbuild script I wrote.

While in ClearCase it is not a best practice having a individual stream for each developer, good CI demands private builds to be run before commiting the code. Added to that, ideally i would have atomic commits, which ClearCase provides just on the form of Deliver to stream.

Currently we are working directly on integration stream, and sometimes our builds fail because Jenkins starts building before the developer finishes her check-ins.

My question is, how can I have a private work area (Sandbox) and atomic commits on ClearCase without creating a stream for each developer? Am I missing something?

Community
  • 1
  • 1
Marcos Brigante
  • 974
  • 9
  • 25
  • First question on SO, welcome :) Glad I didn't had to answer it through twitter message. 140 chars are rarely enough when it comes to ClearCase... – VonC Jan 25 '12 at 19:41
  • Thanks! I've always found my answers here without questioning... ^^ And you are right, ClearCase answers are always full of details. – Marcos Brigante Jan 25 '12 at 22:55

1 Answers1

1

Currently we are working directly on integration stream, and sometimes our builds fail because Jenkins starts building before the developer finishes her check-ins

You can write your build script in order to detect if a deliver is in progress.
A deliver is characterized by an activity named deliver.xxx: you can list its content and see if any version in it is in checkout. If yes, the deliver is in progress.
If the most recent deliver has only checked-in versions, you can safely start your build.


Or:

How can I have a private work area (Sandbox) and atomic commits on ClearCase without creating a stream for each developer

A private area for Jenkins to use would be a snapshot view on each developer stream.
As the name suggests, a snapshot view would take a snapshot of the code, but you need to define a criteria suggesting that Jenkins can build what the snapshot view has updated.

What I have seen used is a 'BUILD' shifting label (a label you re-apply on the newly updated code, and used by Jenkins in his snapshot view with a selection rule based on that label):
The developer move his/her label when he/she thinks the current code is ready to be build, and a Jenkins jobs update its snapshot view on the developer stream, based on the versions referenced by said shifting label 'BUILD'.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • "private area for Jenkins to use would be a snapshot view on each developer stream." - Why would I put Jenkins to work on a developer stream? Of course I could do that but its the same if I, as a developer, run my build script on a command line myself... You mean that I must have a stream for each developer, even when it is not a best practice? – Marcos Brigante Jan 25 '12 at 21:57
  • @MarcosBrigante If you *really* want privacy for each developer, you need a stream per developer with ClearCase (as opposed to RTC, where you can use a repository workspace). Only a stream per developer allows true isolation. But, as I have mentioned before, this is madness (in term of deliver/rebase operations). – VonC Jan 25 '12 at 22:14
  • @MarcosBrigante I would reserve private builds as a script launched by the developer in his/her own snapshot view (which provides a semi-isolation as long as he/she doesn't update said snapshot view against the common Stream) – VonC Jan 25 '12 at 22:15
  • @MarcosBrigante: And atomic commits are kind of supported with the latest ClearCase versions: http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14591192 – VonC Jan 25 '12 at 22:16
  • @MarcosBrigante doesn't matter (you will with 15 rep). As long as you get some solution out of this answer, it will be fine. – VonC Jan 25 '12 at 22:58
  • We will start using RTC this year (I hope), so maybe that's the way to solve the problem. – Marcos Brigante Jan 25 '12 at 22:59
  • @MarcosBrigante I confirm that most of the issues we had with ClearCase pretty much vanish with RTC and its Jazz Source Control module. – VonC Jan 25 '12 at 23:00