Plugin Information
Turns a Hudson cluster into a general purpose batch job execution environment through an SSH-like CLI. Use Case
UsageThe following example runs "uname -a" command on a slave with the 'linux' label (if the -l option is optional.) $ java -jar hudson-cli.jar -s http://server/hudson/ dist-fork -l linux uname -a [distfork5384565281499633486.tmp] $ uname -a Linux bear 2.6.28-13-generic #44-Ubuntu SMP Tue Jun 2 07:55:09 UTC 2009 x86_64 GNU/Linux The following example starts a Tomcat somewhere in a Hudson cluster, with a port-forwarding from the port 9999 to the HTTP listener of Tomcat. % java -jar hudson-cli.jar -s http://localhost:8080/ dist-fork -z ~/apache-tomcat-5.5.27.tar.gz \\
-L 9999:localhost:8080 apache-tomcat-5.5.27/bin/catalina.sh run
[distfork6313354709312415597.tmp] $ apache-tomcat-5.5.27/bin/catalina.sh run
Jul 15, 2009 12:25:31 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on ...
Jul 15, 2009 12:25:31 PM org.apache.coyote.http11.Http11BaseProtocol init
...
Features
Available Command Line Arguments -F LOCAL=REMOTE : Remote files to be copied back to local locations after
the execution of a task
-L PORT:HOST:PORT : Local to remote port forwarding
-R PORT:HOST:PORT : Remote to local port forwarding
-Z FILE : Bring back the newly added/updated files in the target
remote machine after the end of the command by creating a
zip/tgz bundle and place this in the local file system by
this name.
-d N : Estimated duration of this task in milliseconds, or -1 if
unknown
-e NAME=VAL : Environment variables to set to the launched process
-f REMOTE=LOCAL : Local files to be copied to remote locations before the
exeuction of a task
-l VAL : Label for controlling where to execute this command
-n VAL : Human readable name that describe this command. Used in
Hudson's UI.
-z FILE : Zip/tgz file to be extracted into the target remote
machine before execution of the command
ChangelogVersion 1.1 (Nov 19 2010)
Version 1.0 (Jul 15 2009)
|
Comments (4)
Jan 08, 2010
J. Longman says:
Where do I get cli.jar? Is it available as a link from the hudson instance?Where do I get cli.jar? Is it available as a link from the hudson instance?
Jan 09, 2010
J. Longman says:
Found it - it's maybe worth linking the Hudson CLI wiki page, and of course the ...Found it - it's maybe worth linking the Hudson CLI wiki page, and of course the jar has changed name to hudson-cli.jar.
Jan 25, 2010
J. Longman says:
This is really cool. I'm currently walking a series of git commits, farming out ...This is really cool. I'm currently walking a series of git commits, farming out to a hudson instance which is building each commit, 10 commits at a time.
nb: Some of the xargs options may be FreeBSD specific.
The only thing is that right now my script is NOT printing the SHA1 ID of the failed build, probably the sudo and jexec are interfering with the detection of the build failure.
Feb 28
Damon says:
I may be misinterpreting what this plug-in is meant to achieve. I may also be do...I may be misinterpreting what this plug-in is meant to achieve. I may also be doing something wrong with it. I'm assuming that this is a base for running work (a script file...anything really) in parallel on multiple jenkins nodes at once in the form of a job. I tried this two ways:
java -jar $WORKSPACE/../../jenkins-cli.jar -s http://10.86.135.202:8080/ dist-fork -l nodeA -z job.zip -n TINE1 -d "-1" scripts/init.sh
java -jar $WORKSPACE/../../jenkins-cli.jar -s http://10.86.135.202:8080/ dist-fork -l nodeB -z job.zip -n TINE2 -d "-1" scripts/init.sh
I can watch and not exit the initiating job until the two don't exit. The problem is if I abort I end up with orphaned processes. I feel like it was intended to work the way I tried it in option 1 and maybe I'm doing something wrong. Feel free to redirect me if this is a more suited comment for another forum.