This is an automated email from the ASF dual-hosted git repository. dfoulks pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
commit 3627dabd1c3a5b02e12e5fab94828c13ca024628 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Tue Apr 20 14:57:45 2021 +0200 Added Exec Sink Kamelet --- exec-sink.kamelet.yaml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/exec-sink.kamelet.yaml b/exec-sink.kamelet.yaml index bafa104..78bbadf 100644 --- a/exec-sink.kamelet.yaml +++ b/exec-sink.kamelet.yaml @@ -12,6 +12,12 @@ spec: title: Exec Sink description: |- Execute system commands + + The Kamelet expects the following headers to be set: + + - `args/ `ce-args`: as the args to be set on the executable. + + If the header won't be set the executable will be run without arguments. required: - executable - args @@ -20,17 +26,23 @@ spec: title: Executable command description: The command to execute type: string - args: - title: The arguments - description: Arguments to pass to the executables - type: string flow: from: uri: kamelet:source steps: + - choice: + when: + - simple: "${header[args]}" + steps: + - set-header: + name: CamelExecCommandArgs + simple: "${header[args]}" + - simple: "${header[ce-args]}" + steps: + - set-header: + name: CamelExecCommandArgs + simple: "${header[ce-args]}" - to: uri: "exec:{{executable}}" - parameters: - args: "{{args}}" - set-body: simple: "${body.stdout}"