This plugin defines a new build type to execute a shell command in a cross-platform environment.


Cross platform shell executor.

Using Jenkins built-in "Execute Windows batch command" you can run commands using the windows shell.

Using Jenkins 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 Jenkins. 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...



Write your command in the *nix style:

php scripts/build.php $JOBPARAM1

If the command runs on a *nix node, the command runs un-altered. If it runs on a Windows node, it is changed to:

php scripts\build.php %JOBPARAM1%

Note that the file separator and variable naming convention have changed.

... and what it does not!

Command translation problem


It cannot translate any command! So you cannot write

rm -rf bin

because on windows rm command is not available.


You can wrap your commands in two scripts, one for windows and one for unix, each one calling the right command for the operating system:

rm -rf bin
del /F /S bin

and then call clean using an XShell build step.
This will execute clean in unix and clean.bat in windows.


Build step configuration

To add a XShell build step


Version history

Version 0.10 (Dev)

Version 0.9 (Nov 10, 2013)

Version 0.8 (Apr 11, 2012)

Version 0.7 (Dec 29, 2011)

Version 0.6 (Mar 1, 2011)

Version 0.4 (Sep 22, 2010)

Version 0.3 (May 18, 2010)

Version 0.2 (Mar 26, 2010)

Version 0.1 (Mar 25, 2010)