From b8d6c8724821d9acd879fc909f98f1d0de2fcd5d Mon Sep 17 00:00:00 2001 From: kev Date: Fri, 26 Mar 2021 12:46:59 +0800 Subject: [PATCH] update webhook --- webhook/Dockerfile | 5 +++-- webhook/data/hooks.json | 9 +-------- webhook/data/test.sh | 3 +++ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/webhook/Dockerfile b/webhook/Dockerfile index d18e9eb..b9a2e50 100644 --- a/webhook/Dockerfile +++ b/webhook/Dockerfile @@ -11,7 +11,7 @@ RUN apk add --no-cache git RUN go get -d -v github.com/adnanh/webhook RUN go build --ldflags '-s -extldflags "-static"' -i -o webhook github.com/adnanh/webhook -FROM alpine +FROM alpine:3 MAINTAINER EasyPi Software Foundation RUN apk add --no-cache bash coreutils curl jq COPY --from=build /go/bin/webhook /usr/local/bin/ @@ -19,4 +19,5 @@ WORKDIR /etc/webhook VOLUME /etc/webhook EXPOSE 9000 ENTRYPOINT ["webhook"] -CMD ["-hooks", "hooks.json", "-hotreload", "-template", "-verbose"] +# Doc: https://github.com/adnanh/webhook/blob/master/docs/Webhook-Parameters.md +CMD ["-hooks", "hooks.json", "-hooks", "hooks.yaml", "-hotreload", "-template", "-verbose"] diff --git a/webhook/data/hooks.json b/webhook/data/hooks.json index e176317..fe51488 100644 --- a/webhook/data/hooks.json +++ b/webhook/data/hooks.json @@ -1,8 +1 @@ -[ - { - "id": "test", - "execute-command": "/etc/webhook/test.sh", - "command-working-directory": "/etc/webhook", - "include-command-output-in-response": true - } -] +[] diff --git a/webhook/data/test.sh b/webhook/data/test.sh index 7e979d2..cb34193 100755 --- a/webhook/data/test.sh +++ b/webhook/data/test.sh @@ -1,2 +1,5 @@ #!/bin/bash + echo 'hello world' + +cat $HOOK_PAYLOAD