Issue
See title. Currently, I do either run the scripts on Windows with a CMD or by using a shell on Linux. This seems a bit unflexible to me since it limits the jobs to be run either on Windows or on Linux.
How would I define a job which simply does run my test scripts written in Perl/Python/Ruby/WhateverOtherScriptingLanguage regardless on which OS the Jenkins instance is running.
The correct script interpreter can be assumed as installed, of course.
Solution
The cross-platform shell plugin solves exactly this problem -- however, the last release was done in 2014, and there's a couple of open issues that might prevent you from using it in a production environment.
As an alternative, there is plugins for wrapping the actual call to the interpreter into plugin code. With a plugin, you become independent from OS-specific shells. However, the plugin will be language-specific, e.g.,
- For Python, the ShiningPanda plugin is popular
- For Ruby, the Ruby plugin will do that (albeit only for embedded scripts)
- For Perl, there is no such thing
In any case, you'd depend on availability and maintenance of an additional plugin. Plus, adding fat plugins to Jenkins just to wrap a system call is somewhat awkward.
I reckon that the most versatile and compact solution is to introduce a Groovy build step, and to start the interpreter with a one-liner from there, e.g.:
"perl myscript.pl".execute();
This will work on any platform, as long as you ensure that Groovy is available, e.g. by using the Groovy plugin.
If you prefer Python, you can probably do the same with short wrapper that you start via the ShiningPanda plugin.
Answered By - Alex O
Answer Checked By - Cary Denson (JavaFixing Admin)