This plugin is currently in beta. While it is considered safe for use, please be aware that its API could change in ways that are not compatible with earlier versions in future releases, or it might become unsupported.
Execute a Ruby script using the GraalVM scripting engine.
yaml
type: "io.kestra.plugin.graalvm.ruby.Eval"
Execute a Ruby script using the GraalVM scripting engine.
yaml
id: evalRuby
namespace: company.team
tasks:
- id: evalRuby
type: io.kestra.plugin.graalvm.ruby.Eval
outputs:
- map
- out
script: |
Counter = Java.type('io.kestra.core.models.executions.metrics.Counter')
FileOutputStream = Java.type('java.io.FileOutputStream')
# all variables must be imported before use
logger = Polyglot.import('logger')
runContext = Polyglot.import('runContext')
logger.info('Task started')
runContext.metric(Counter.of('total', 666, 'name', 'bla'))
map = {test: 'here'}
tempFile = runContext.workingDir().createTempFile().toFile()
output = FileOutputStream.new(tempFile)
output.write('Hello World'.bytes)
out = runContext.storage().putFile(tempFile)
return {map: map, out: out}
Dynamic
YES
The script to evaluate
SubType string
Dynamic
YES
A List of outputs variables that will be usable in outputs.
The captured outputs as declared on the outputs
task property.