csantanapr commented on a change in pull request #2369: document how to add swift dependencies URL: https://github.com/apache/incubator-openwhisk/pull/2369#discussion_r124875377
########## File path: docs/actions.md ########## @@ -636,49 +636,69 @@ When you create an OpenWhisk Swift action with a Swift source file, it has to be To avoid the cold-start delay, you can compile your Swift file into a binary and then upload to OpenWhisk in a zip file. As you need the OpenWhisk scaffolding, the easiest way to create the binary is to build it within the same environment as it will be run in. These are the steps: - Run an interactive Swift action container. -``` -docker run --rm -it -v "$(pwd):/owexec" openwhisk/swift3action bash -``` - This puts you in a bash shell within the Docker container. Execute the following commands within it: - -- Install zip for convenience, to package the binary ``` - apt-get install -y zip + docker run --rm -it -v "$(pwd):/owexec" openwhisk/action-swift-v3.1.1 bash ``` + This puts you in a bash shell within the Docker container. - Copy the source code and prepare to build it ``` cp /owexec/hello.swift /swift3Action/spm-build/main.swift ``` - ``` cat /swift3Action/epilogue.swift >> /swift3Action/spm-build/main.swift ``` - ``` echo '_run_main(mainFunction:main)' >> /swift3Action/spm-build/main.swift ``` + Copy any additional source files to `/swift3Action/spm-build/` -- Build and link +- (Optional) Create Package.swift + If you need to add dependencies create a Package.swift file like the following: Review comment: I will make it one sentence, to avoid problems with bullets. ---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
