commit | ce4a603a7eec9da12e6d629b2d528f6055ce9a7b | [log] [tgz] |
---|---|---|
author | ningyougang <415622920@qq.com> | Mon Aug 15 22:58:08 2022 +0800 |
committer | GitHub <noreply@github.com> | Mon Aug 15 10:58:08 2022 -0400 |
tree | 1b008074272eb52fe34c56c3d90e285edf4bcde6 | |
parent | 1971f38becbd2aae623e6b55dd22ba18d5b6675d [diff] |
Support array result include sequence action (#14)
This repository contains sources files needed to build the Deno runtimes for Apache OpenWhisk. The build system will produce a Docker image for each runtime version. These images are used in the platform to execute Deno actions.
Try it out using Docker image:
wsk action create hello main.ts --docker=openwhisk/action-deno-1.3.0
The content of the main.ts
is shown below.
export default (args: any) => { return { message: `Hello, ${args.name || 'World'}!` } }
For the return result, not only support dictionary
but also support array
So a very simple hello array
function would be:
export default (args: any) => { return ["a", "b"] }
And support array result for sequence action as well, the first action‘s array result can be used as next action’s input parameter.
So the function can be:
func main(args: Any) -> Any { return args }
When invokes above action, we can pass an array object as the input parameter.
A Dockerfile for each runtime image is defined in its respective runtime version directory. Modify this file if you need to add extra dependencies to a runtime version.
distDocker
command to generate local Docker images for the different runtime versions../gradlew distDocker
Build the local Docker images for the Deno runtime (see the instructions above).
Install project dependencies from the top-level Apache OpenWhisk project, which ensures correct versions of dependent libraries are available in the Maven cache.
./gradlew install
This command MUST BE run from the directory containing the main Apache OpenWhisk repository, not this repository's directory.
./gradlew :tests:test