Plugin Information
This plugin defines a new build type to execute a shell command in a cross-platform environment. DescriptionCross platform shell executor. Using Hudson built-in "Execute Windows batch command" you can run commands using the windows shell. Using Hudson built-in "Execute shell" you can run commands using unix shell. If you need to run a job cross platform you cannot use the two standard executors provided by Hudson. You need a "build step" that can be executed both in Windows and in Unix. This plugin does exactly this: it takes a command, as the two standard build steps do, and executes it calling the correct shell depending on the operating system running on the current job executor. What it does...
Constraints:
Examples: Example 1: run executable + script php scripts/build.php runs php (must be in Path) with scripts/build.php as argument (path relative to workspace; forward slashes can be used because php handles them correctly in any OS). this command is equivalent to the following php scripts\build.php The file separator will be automatically translated to the right one, according to the operating system running during execution. ... and what it does not!Command translation problemDescriptionIt cannot translate any command! So you cannot write rm -rf bin because on windows rm command is not available. SolutionYou can wrap your commands in two scripts, one for windows and one for unix, each one calling the right command for the operating system: clean rm -rf bin clean.bat del /F /S bin and then call clean using an XShell build step. Variable expansion problemDescriptionTranslate variable expansion syntax in the command line provided to the plugin. So you want to write something like this: myscript $JOBPARAM1 or myscript %JOBPARAM1% This won't work because each of this command will only work in one OS, not in both. SolutionYou can wrap your commands in two scripts, one for windows and one for unix, each one calling the right command for the operating system: script-wrapper myscript $JOBPARAM1 script-wrapper.bat myscript %JOBPARAM1% and then call script-wrapper using an XShell build step. Notes
Build step configurationTo add a XShell build step
TODO
Version history0.5 (Development)0.4 (09/22/2010)
0.3 (05/18/2010)
0.2 (03/26/2010)
0.1 (03/25/2010)Initial release
|
Comments (6)
May 17, 2010
Axel Heider says:
Could you add these things: "run from sub-directory", where slashes are conver...Could you add these things:
I have a workspace where the following scripts should run: foo/bar/doItAll, foo/bar/doItAll.bat.
If I give "foo/bar/doItAll", the linux build works, but windows gives this:
[trunk] $ cmd.exe /C '"foo/bar/doItAll && exit %%ERRORLEVEL%%"'
command not found
Finished: FAILURE
Exmaple: AXIS1=[alpha,beta], AXIX2=[foo,bar]. in the scripts, the variables AXIS1 and AXIX2 should be set.
May 15, 2010
Marco Ambu says:
Hi, I have changed the plugin to replace '\' and '/' with File.separator. I gu...Hi,
I have changed the plugin to replace '\' and '/' with File.separator.
I guess this should be enough to solve your first problem... about the second... maybe it will take some more time.
May 17, 2010
Axel Heider says:
Thanks. Does ist also convert the slashes the other way, ie "/" to "\"?Thanks. Does ist also convert the slashes the other way, ie "/" to "\"?
May 18, 2010
Marco Ambu says:
Yes, it works in both ways. I have released 0.3 with this modification included...Yes, it works in both ways.
I have released 0.3 with this modification included. I have tried it in my test installation, can you try it and report any problem or other suggestion? Thanks.
Sep 22, 2010
Marco Ambu says:
I have added the build variables to the environment variables; if the variables ...I have added the build variables to the environment variables; if the variables added in a matrix project are 'build variables' maybe we have solved the issue you reported (2nd item in your comment).
Sep 22, 2010
Sorin Sbarnea says:
I suspect that this plugin is borken, see http://issues.hudson-ci.org/browse/HUD...I suspect that this plugin is borken, see http://issues.hudson-ci.org/browse/HUDSON-7538
I tried to assign the bug to the `xshell` component but there is no component with this name.