Skip to content

Commit

Permalink
🐛 fix(workflows): fix curl command in faas_fn_build_invoke.yml
Browse files Browse the repository at this point in the history
🐛 fix(handler.clj): fix handler function to accept and return content instead of a map
  • Loading branch information
ccfontes committed Aug 20, 2023
1 parent 0666ef4 commit 9367ec9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/faas_fn_build_invoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ jobs:
(docker rm bb-http-map || exit 0)
docker run -d --name bb-http-map ghcr.io/${{ github.repository_owner }}/bb-http-map:latest bb --main index
docker logs bb-http-map
if [ "$(docker exec bb-http-map curl -X POST --data-raw '{"foo": "bar", "spam": "eggs"}' --retry 3 --retry-delay 2 --retry-connrefused http://127.0.0.1:8082)" != '[["foo","spam"],["bar","eggs"]]' ]; then
if [ "$(docker exec bb-http-map curl -X POST --data '{"foo": "bar", "spam": "eggs"}' --retry 3 --retry-delay 2 --retry-connrefused http://127.0.0.1:8082)" != '[["foo","spam"],["bar","eggs"]]' ]; then
exit 6
fi
(docker stop bb-http-map-context || exit 0)
(docker rm bb-http-map-context || exit 0)
docker run -d --name bb-http-map-context ghcr.io/${{ github.repository_owner }}/bb-http-map-context:latest bb --main index
docker logs bb-http-map-context
if [ "$(docker exec bb-http-map-context curl -X POST --data-raw '{"foo": "bar", "spam": "eggs"}' --retry 3 --retry-delay 2 --retry-connrefused http://127.0.0.1:8082)" != '[["foo","spam"],["bar","eggs"],"application/json",true]' ]; then
if [ "$(docker exec bb-http-map-context curl -X POST --data '{"foo": "bar", "spam": "eggs"}' --retry 3 --retry-delay 2 --retry-connrefused http://127.0.0.1:8082)" != '[["foo","spam"],["bar","eggs"],"application/json",true]' ]; then
exit 7
fi
4 changes: 2 additions & 2 deletions template/bb/function/handler.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns function.handler)

(defn handler [{:keys [body]}]
{:body body})
(defn handler [content]
content)

0 comments on commit 9367ec9

Please sign in to comment.