1

Using a Clearcase Dynamic view, Hudson's job log shows cleartool's lsview, startview and lshistory commands are all successful.
However, the subsequent build script (SunOS KornShell (ksh)) fails to access the view's directories.

Running "cleartool pwv" instead of the shell script yields:

Working directory view: ** NONE **
Set view: ** NONE **

Which confirms that the Hudson-invoked shell appears to running in it is own world.
Is this the correct Hudson behavior or have we configured it incorrectly?

P.S. the ksh script can be tweaked, but it is one of those legacy things we have to keep.

javaPlease42
  • 4,699
  • 7
  • 36
  • 65
belwood
  • 3,320
  • 11
  • 38
  • 45

1 Answers1

2

If you want cleartool pwv to return a view, you need to make sure your script will execute itself with a view path (/view/myDynamicView for dynamic views).

I recommend using an existing dynamic view in your Hudson job.

I wouldn't use in your script a path like /vobs/aVob/.../ because /vobs is a mounting point (only one) to be set for one dynamic view. And your script might not have set said dynamic view (to /vobs, see cleartool setview). Using the full absolute path is more robust.
(Note: I don't know if your script use this shortcut, but I just mention here to cover fully this topic)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Sound promising, but I have two questions now. 1. We are using an existing dynamic view, but the path is /blah/viewstore/views instead of /view (and we've configured that in Hudson) - is this a problem? 2. duh, the scripts to run are on /vobs/project/scripts directory only available within the view. Will this still work? – belwood Feb 14 '11 at 18:08
  • Also, the script does set the view (and the output says it's successful), but the subsequent script logic complains a view needs to be set - wierd. – belwood Feb 14 '11 at 18:13
  • @belwood: if by `viewstore` you are referring to a view storage, then I believe this isn't what the field '`view root`' means. `/view/myDynamicView` is more appropriate. 2. I would really recommend avoiding `/vobs/`. It creates a subprocess in which you aren't sure of your environment variable. If you need a fixed path, make first a link to the right view, and use that symbolic link (not tested myself). If you still want to use `/vobs`, then you need to make sure `cleartool setview` has been run first. – VonC Feb 14 '11 at 18:14
  • @belwood: again, `cleartool setview` set the view and create a subprocess, which I don't think the Hudson process has access to. I always found that '`setview`' business more troublesome than useful. – VonC Feb 14 '11 at 18:16
  • Solved one of the shell issues by invoking "cleartool setview -exec 'buildscript.ksh' $CLEARCASE_VIEWNAME" instead of having the 2 commands on separate lines in the Hudson Shell box. This part works flawlessly so far. Now we're looking at how to remove the /vobs dependency. Thanks again! – belwood Feb 15 '11 at 22:07
  • @belwood: but if you are making the `cleartool setview` bit work, then you have to use the `/vobs/...` path, haven't you? (since `setview` is all about mounting the right view content on `/vobs`) – VonC Feb 15 '11 at 22:18
  • Disregard the /vobs dependency comment; re-read your earlier comment, but not while on crack %-). It makes more sense now -- thanks again. – belwood Feb 16 '11 at 17:42
  • @belwood: I didn't know about the "on crack" smiley %-). Excellent! :) – VonC Feb 16 '11 at 17:45