views:

384

answers:

3

I'm trying to setup TeamCity to work with ClearCase for continuous integration, and I've been having a few problems. TeamCity is complaining that it cannot build the patch for the build. I've been scouring the internet for information on ClearCase and TeamCity, and there is a surprisingly small amount of information on the topic. Has anyone had any success with getting TeamCity to work with ClearCase?

Here's my build log:

[18:09:11]: Updating sources (2s)
[18:09:13]: [Updating sources] Failed to build patch for build #1.0.23-November-2009.18:09:09, build id: 10, VCS root: ClearCase, due to error: Cannot get version in view 'D:\CCdata\my_vob\my_project' for the directory D:\CCdata\my_vob\my_project
[18:09:13]: Will repeat attempt when server will be available, number of attempts left: 2
[18:09:23]: Updating sources (1s)
[18:09:25]: [Updating sources] Failed to build patch for build #1.0.23-November-2009.18:09:09, build id: 10, VCS root: ClearCase, due to error: Cannot get version in view 'D:\CCdata\my_vob\my_project' for the directory D:\CCdata\my_vob\my_project
[18:09:25]: Will repeat attempt when server will be available, number of attempts left: 1
[18:09:35]: Updating sources (2s)
[18:09:37]: [Updating sources] Failed to build patch for build #1.0.23-November-2009.18:09:09, build id: 10, VCS root: ClearCase, due to error: Cannot get version in view 'D:\CCdata\my_vob\my_project' for the directory D:\CCdata\my_vob\my_project
[18:09:37]: [Updating sources] Patch is broken, can be found in file: C:\TeamCity\buildAgent\temp\cache\temp58518patch10
[18:09:37]: [Updating sources] Error while applying patch: Failed to build patch for build #1.0.23-November-2009.18:09:09, build id: 10, VCS root: ClearCase...

Here's the teamcity-vcs.log file:

+2  A: 

As mentioned in the question Continuous Integration with Teamcity and Clearcase, we (a colleague and I) did manage to make TeamCity interact efficiently with ClearCase, but:

  • only after rewritten their ClearCase plugin, and
  • only with dynamic views as a source to lookup for changes (the update of a large snapshot view was simply taken too much time)


The dynamic view is the only way to go for this kind of plugin, but their original implementation is not efficient (doing some cleartool describe for every file that has changed!)

The "path to ClearCase view" should refer to a full path to the sources within your ClearCase view (see this thread for instance)

The error message was seen in may 2009, but was fixed at the time. What path are you using?


Regarding your report on JetBrain, your config spec seems weird to me.
I would go with:

  #View files that are checked out.
  element * CHECKEDOUT

  #View files under the MyProject/LATEST branch.
  element /My_vob/... .../MyProject/LATEST

  #Create the MyProject branch.
  element -file /My_vob/... R5.0.0.0 -mkbranch MyProject
  element -dir * /main/LATEST -mkbranch MyProject

  load /My_vob

(Note:

  • the '/' instead of the '\': both works well with ClearCase, but TeamCity plugin seems to prefer '/'
  • .../MyProject instead of /main/MyProject: avoid to assume where a branch is
    )
VonC
I'm trying to just get TeamCity to work with a snapshot view or a dynamic view. I guess dynamic view is the way to go, since everyone is complaining how slow snapshot views are. I cannot even get a dynamic view setup. I am confused what to put in the ClearCase view path of the VCS setting. I keep getting the error: 'is not a path to ClearCase view'.
Andrew Garrison
I got it to accept the view path for a dynamic view, but I'm still getting the exact same error in my original post: "Failed to build patch for build"....."Cannot get version in view."
Andrew Garrison
Could this be a permission problem in ClearCase? I have TeamCity setup to use my user account, maybe my user account is not correctly setup for TeamCity or even for doing normal operations on this dynamic view.
Andrew Garrison
I have attached the teamcity-vcs.log file to the post at jetBrains forums. The teamcity-clearcase.log file was not generated. I'll have to look into how to get that one to generate.
Andrew Garrison
I also tried your suggestions with the config spec, but that did not change the outcome.
Andrew Garrison
+1  A: 

Andrew, we had the same issue that you're experiencing now.

Jetbrains's plugin is fatally flawed, they do a helluva lot of ct lsvtree and ct describe to build a cache to find what versions were created at what time (for each version of each element visible under the clearcase view). That's why we coded our own plugin. It uses instead the time directive of the clearcase config spec as VonC described here : http://stackoverflow.com/questions/1688061/continuous-integration-with-teamcity-and-clearcase

Gilles Philippart
+2  A: 

This error was caused by my config spec. Changing two lines with the pattern /My_vob/... to * seemed to fix the problem. I don't know why TeamCity had a problem with the more precise pattern, but changing it to * seemed to fix this problem.

Here's the original config spec:

#View files that are checked out.
element * CHECKEDOUT

#View files under the MyProject/LATEST branch.
element /My_vob/... .../MyProject/LATEST

#Create the MyProject branch.
element -file /My_vob/... R5.0.0.0 -mkbranch MyProject
element -dir * /main/LATEST -mkbranch MyProject

And I just changed two lines (replaced occurrences of /My_vob/... with *)

#View files that are checked out.
element * CHECKEDOUT

#View files under the MyProject/LATEST branch.
element * .../MyProject/LATEST

#Create the MyProject branch.
element -file * R5.0.0.0 -mkbranch MyProject
element -dir * /main/LATEST -mkbranch MyProject
Andrew Garrison
It is because `/...` means 'the element and all its sub-elements'. Meaning `/My_vob/... .../MyProject/LATEST` means `My_Vob` must have a '`MyProject`' branch, which it may not necessarily have. `*` works because if `My_Vob` does not have a '`MyProject`' branch, it simply skip to the rule `element -dir * /main/LATEST -mkbranch MyProject`, selection `/main/LATEST`, waiting for any change to create a `MyProject`branch. Good catch. +1
VonC