Quantcast
Channel:
Viewing all articles
Browse latest Browse all 43909

Wiki Page: stcmdEx - A Stateless Command Line Execution Environment and alternative to stcmd

$
0
0
A stateless, non-interactive command line batch file for the 13.0 SDK can be downloaded from  ftp://us.ftp.microfocus.com/StarTeam/13.0/stcmdEx.zip (Please copy this link into your browser window) The .zip consists of a single .jar file. Extract the .jar to your sdk 13.0\lib folder where starteam130.jar resides.   stcmdEx can be directly integrated into existing Microsoft Windows batch files (or Unix shell scripts) using the following syntax: java.exe -jar stcmdEx.jar command-line-command-with-parameters e.g., on Windows... "C:\Program Files\Borland\Java\Oracle1.7.0_17\bin\java.exe" -jar "C:\Program Files\Borland\StarTeam SDK 14.0\lib\stcmdEx.jar" co /p \"Administrator:Administrator@localhost:49201/Project Name/View Name\" /is /rp \"c:\temp\" /filter \"GIMOU\" /o /vb c:\temp\output.txt Note: When passing command arguments within Microsoft Windows command prompts or bat files, " needs to be escaped with a \ so that the " itself gets streamed as part of the argument. On Microsoft Windows platforms, stcmdEx can be incorporated into its own .bat file if necessary. Add the next two lines to a .bat file (stcmdEx.bat), which may then be called from a driving batch script. use %* to pass all parameters individually quoted as passed to the command batch script itself. @echo ON "C:\Program Files\Borland\Java\Oracle1.7.0_17\bin\java.exe" -jar "C:\Program Files\Borland\StarTeam SDK 14.0\lib\stcmdEx.jar" %*          similarly, it may be  embedded in a unix (bash) shell script where you use "$@" to pass all parameters individually quoted as passed to the script itself. #!/usr/bin/env bash java -jar /path/to/stcmdEx.jar "$@"   Using stcmdEx. you can run the 13.0 command line engine with no local client server dependency, as long as every command issued through this script uses -p, i.e. is stateless. In addition, you can run command line jobs in parallel, since stcmdEx launches the SDK in process, executes the command, returns the results, then releases the SDK. This model differs from stcmd, which is a fully stateful engine. stcmd supports the ability to connect to the starteam server, set a project/view/folder(s) context, then execute a series of commands, changes the project/view/folder(s) context, finally disconnect. To provide a stateful context, stcmd is client-server on your local machine. hence stcmd.exe launches an stcmd client in process which opens a socket connection to a running stcmd server on the local machine, which in turn maintains the connection context to the StarTeam server across the network. As a result, a sequence of stcmd commands may be executed which launch and release the stcmd client as they run, leaving the local stcmd server up and running. While this covers all single batch script use cases, it does not support multiple batch scripts possibly running in parallel on the same machine. Since stcmdEx on the other hand launches and runs the SDK in process, multiple parallel invocations of the script will each run in their own process spaces (jre runtime). Besides supporting batch parallelism, this solution has the inherent advantage of fewer moving parts (processes) involved, and is better suited for integration into scripting environments like Ant or Hudson. The stcmdEx.jar file consists of a manifest, a .java file (StatelessClient.java) and a byte compiled .class file (StatelessClient.class). The java implementation is relatively straightforward, simply invoking the SDK's CommandProcessor engine with the specified parameters. Changing the Class Path in the manifest to target the 12.5 SDK is sufficient to make this work in a 12.5 environment as well. stcmdEx is distributed with the 14.0 SDK installer.

Viewing all articles
Browse latest Browse all 43909

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>