Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shell script support #50

Open
jonnor opened this issue Oct 9, 2016 · 2 comments
Open

Shell script support #50

jonnor opened this issue Oct 9, 2016 · 2 comments

Comments

@jonnor
Copy link
Member

jonnor commented Oct 9, 2016

For quick & dirty work, for instance when prototyping, it can be very useful to have a MsgFlo participant based on shell scripts, and mostly calling existing programs.

This can be done fairly simply in Python or Node.js, but one always needs to write some custom code, and this "host" wrapper code obscures the real meat; the commandline/script that is being run.
One could imagine a generic msgflo-script which would take on the commandline.

  1. A shell script snippet
  2. A string description of the component
  3. Standard configuration like role/broker
    It would then always expose an in port, and have outports out and error. The input message payload is provided as stdin. If the script (all commands in it) passes, the anything produced on stdout is send on out. Otherwise, stderr is sent on err.

If it is JSON input, script can for instance use jq to query https://stedolan.github.io/jq/ it

@jonnor
Copy link
Member Author

jonnor commented Oct 9, 2016

Should probably also support a --file to take the script, so it can be used with MsgFlo component library, and have a handler for file on form myscript.sh.

@jonnor
Copy link
Member Author

jonnor commented Oct 9, 2016

Ideally also support --iips, and transform those into variables or envvars, accessible in the script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant