Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
488 views
in Technique[技术] by (71.8m points)

clearcase remote client - How can I use non-interactive mode of CCRC?

I'm using rcleartool 8.0.0.6 in windows machine. Is there any way to use rcleartool non-interactive mode?

For example, if I type: rcleartool lsview -s, the client will ask me to input Server URL, username/password in interactive mode.

Is there anyway to use rcleartool lsview -s -username [username] -pass [password] -server [server]?
I want to use that command in my java code, so non-interactive mode should be better?
Any suggestions?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

ClearTeam 8.x

As mentioned in "The ClearCase 8.x remote client command-line interface (rcleartool)":

rcleartool is the command-line interface to the IBM Rational ClearCase remote client (CCRC).
This interface, first released as a separate download for compatibility with V7.1.2.x and later releases, is delivered in V8.0.0.3 with the changes that are described in this document.

rcleartool login wasn't caching credentials before (7.x).
It should cache those credential now.

The CR 3508 mentions that enhancement has been delivered June 14th 2013 the RFE (Request for Enhancement):

In CCRC CLI single-line mode, you should only specifiy your login credentials once.

Session caching for rcleartool was delivered in 8.0.0.3

That means after one rcleartool login -lname xxx -server xxx -password xxx, all other rcleartool commands shouldn't need login/password anymore.


ClearCase 7.x

You can try and follow the IBM article "How to run rcleartool without entering username, password and server URL every time"

It suggests modifying the rcleartool.bat script.

Cause

Normally when one runs rcleartool (not under rcleartool prompt), he needs to input username, password and server URL every time.

For instance:

rcleartool lsvob -username myusername -password mypassword -server  http://myserver:12080/TeamWeb/services/Team

rcleartool lsview -username myusername -password mypassword -server  http://myserver:12080/TeamWeb/services/Team

Answer

You can backup the original rcleartool.bat (rcleartool under UNIX) and then modify that file as follows:

Locate the following line in rcleartool.bat

"%_JAVACMD%" -Djava.util.logging.config.file="%CCRCCLI%/logging.properties" -cp "%CM_API_DIR%stpwvcm.jar";"%CM_API_DIR%stpcmmn.jar";"%CM_API_DIR%stpcc.jar";"%CM_API_DIR%
emote_core.jar";"%CM_API_DIR%commons-httpclient-3.0.jar";"%CM_API_DIR%commons-codec-1.3.jar";"%CCRCCLI%commons-cli-1.1.jar";"%CM_API_DIR%icu4j-3_8.jar";"%CM_API_DIR%commons-logging-1.0.4.jar";"%CCRCCLI%
cleartool.jar" com.ibm.rational.ccrc.cli.command.ClearWan %*
Add the username, password and server URL at the end

"%_JAVACMD%" -Djava.util.logging.config.file="%CCRCCLI%/logging.properties" -cp "%CM_API_DIR%stpwvcm.jar";"%CM_API_DIR%stpcmmn.jar";"%CM_API_DIR%stpcc.jar";"%CM_API_DIR%
emote_core.jar";"%CM_API_DIR%commons-httpclient-3.0.jar";"%CM_API_DIR%commons-codec-1.3.jar";"%CCRCCLI%commons-cli-1.1.jar";"%CM_API_DIR%icu4j-3_8.jar";"%CM_API_DIR%commons-logging-1.0.4.jar";"%CCRCCLI%
cleartool.jar" com.ibm.rational.ccrc.cli.command.ClearWan %* -username myusername -password mypassword -server  http://myserver:12080/TeamWeb/services/Team

After making the above change, rcleartool can be used without entering a username, password and server URL every time.

For instance,

rcleartool lsvob
rcleartool lsview

Note that there is still a need for running rcleartool directly (not in rcleartool prompt) such as:

  • Being able to capture the result with > operator.
  • Being able to run in a batch file.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...