I am deploying Environment Modules here at my company and would like to make sure that all use models are covered adequately. Since Groovy is not a supported language by modulecmd.tcl, and tampering with the code base is not an option, I'm wondering what would be simplest way to expose an environment to a Jenkins executor that is based on source $(module load <modulefile>)
(BASH)?
Some possibilities:
- write a translator for stdout of subprocess
.../modulecmd.tcl bash <modulefile>
- write a translator for stdout of subprocess
module load <modulefile> | env
; would need to do some diff'ing to support unload - plugin?
I've looked at "environment script" and "environment injector" plugins but can't test these w/o upgrading Jenkins (plugins are not compatible). I got the impression scripts are supported but would have to output in specific format (more code to write).
Has anyone here been able to integrate Env Modules into a Pipeline, or could give some guidance as to best practice when needing to import an environment that is natively based on sourcing script output that is shell/interpreter specific?