csantanapr commented on issue #3138: Add bash kind action
URL: 
https://github.com/apache/incubator-openwhisk/pull/3138#issuecomment-366863338
 
 
   Recent changes to dockerSkeleton runtime now allows for better support for 
bash actions.
   Using `--native` with a simple script is the recommend way for bash actions.
   
   For example:
   
   bash.sh reads  a line from \<STDIN\>
   ```
   $ cat bash.sh
   #!/bin/bash
   read ARGS
   A=`echo "$ARGS" | jq '."a"'`
   B=`echo "$ARGS" | jq '."b"'`
   C=`echo "$ARGS" | jq '."c"[0]'`
   RES=$(($B + $C))
   echo A is $A
   ```
   ```
   wsk action update bash bash.sh --native
   ```
   ```
   ok: updated action bash
   ```
   
   ```
   wsk action invoke bash -p a A -p b 123 -p c '[1,2,3]' -r
   ```
   ```json
   {
       "result": 124
   }
   ```
   ```
   wsk activation logs --last --strip
   ```
   ```
   A is "A"
   ```
   
   docs will update to reflect this new usage.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to