2

I am trying to execute the following build script and it is returning no error but it is not executing the script inside it. there is a view tag with the following name. it can be seen with cleartool lsview <view-tag>. I can do cleartool setview <view-tag> but it doesn't run the sh /abc/cds/fg/bin/ant -t all.

CLEARCASE_VIEWNAME=NYC_CYN

cleartool setview -exec "newgrp orange; cd /abc/cds/fg/bin; sh /abc/cds/fg/bin/ant -t all -i ' '" $CLEARCASE_VIEWNAME

Thanks for any help !!

Community
  • 1
  • 1
user2370590
  • 837
  • 1
  • 16
  • 31

1 Answers1

1

First, don't use setview. It triggers a sub-shell, which doesn't play well with scripts.
See "Python and ClearCase setview" for a concrete example on how spawning a process has side effects when it comes to scripts.

Use cleartool startview <view-tag> to make sure your dynamic view is started, and then use the full view path:

/view/<view-tag>/vobs/YourVobs/....

In your case:

newgrp orange; 
cd /view/<view-tag>/vobs/abc/cds/fg/bin
sh /view/<view-tag>/vobs/abc/cds/fg/bin/ant -t all -i ' '
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • VonC, But I am not using windows. its a unix ksh shell the jenkins build remotely. Still I need cleartool startview ? thanks for the prompt response – user2370590 Mar 29 '14 at 20:47
  • @user2370590 this is an answer for Unix, with Unix-paths. – VonC Mar 29 '14 at 20:47
  • @user2370590 `startview` is not mandatory, just a precaution. And `setview` doesn't bring you anything here, just troubles. It is better to use the full path of the view instead of trying to mount its content on '`/`' (which `setview` does, in a subprocess). – VonC Mar 29 '14 at 20:49
  • script is not runing after starting the view and providing the full path /view/$CLEARCASE_VIEWNAME/...... – user2370590 Mar 29 '14 at 20:59
  • @user2370590 then `setview` or `starview` isn't the issue. You must first try to rum that script manually to see what command actually works (maybe without the `sh`?). But again, using the full path of the view. – VonC Mar 29 '14 at 21:06