|Parameterized builds using shell [message #1239152]
||Mon, 03 February 2014 13:52
| Laurent Goubet
Registered: July 2009
We have a matrix job that builds EMF Compare for four different target platforms (Luna M5, Kepler, Juno and Indigo) : https://hudson.eclipse.org/emfcompare/job/master-nightly/. However, some of the modules we builds do not compile on Indigo, that's known and we need to disable them from the build on that particular platform.
One solution we thought about was to split our "modules" list into a set of profiles ("core" profile for the core, "uml" profile for the uml-specific modules...) and combine the profiles according to the target platform.
For that, we tried to use the "platform" property directly and activate the profiles according to its value :
But... well, profiles won't allow two conditions of the same type ("property"). So this cannot be used (unless we can change "value" to "contains" or something that would use an "or" operator?).
We then tried to directly specify the list of profiles to activate from the hudson configuration. This requires a little shell script to set the necessary list according to the "platform" axis... But a "Execute Shell" build step cannot "export" an environment variable for use within a subsequence "Invoke Maven" build step (http://stackoverflow.com/questions/1329986/set-environment-variable-for-build-in-hudson)... and it seems like the "envInject" plugin is not compatible with hudson.
All parameters we pass to the "Invoke Maven" build step are either totally escaped (no shell execution anywhere) or plain hardcoded. The only substitution that happens are with "Hudson" variables ... which we cannot value with the result of shell scripts.
Is there any way at all to set a "complex" parameter to an hudson build? Something that a user cannot value (not a plain String) and has to be computed from a script of some sort?
It seems like the only way to do something that would resemble this would be to setup two jobs : one that will execute a shell script that will write its result in the workspace (as a property file) and the second that would be triggerred with these results as parameters... Seems overkill for what sounds like a simple need.
Powered by FUDForum
. Page generated in 0.06103 seconds