Dynamic views of ClearCase not integrating in Jenk

2019-06-03 04:13发布

问题:

We use ClearCase as our Version Control Tool. While Integrating Dynamic view to Jenkins in my job at Execute Shell, it is not getting integrated and throwing errors.

My Commands at Execute Shell:

/usr/atria/bin/cleartool setview johns 
/usr/atria/bin/cleartool catcs
cd /vob1/pts/
ls
pwd
  • First thing, it is not identifying the cleartool path and view.
  • Secondly, it is not entering into VOB (/vob1/pts).
    None of the commands working ... like pwd and ls.

回答1:

Don't use cleartool setview (as I mention in this answer): it spawns a sub-shell which makes any subsequent command not working (because those commands are executed in the parent shell, for which /vobs has been assigned to a view)

Always use the full path of the view: /view/yourView/vobs/yourVob

In your case:

cd /view/johns/vobs/pts
/usr/atria/bin/cleartool catcs
ls
pwd

If the Jenkins ClearCase Plugin is using setview anyway, then, as explained in this blog post, you must make sure it uses a -exe directive:

cleartool setview -exec /tmp/script.sh 

(with /tmp/script.sh including all your other commands)