From 18a2db3101b72c969f621a67bf61d3e03f0e6bcc Mon Sep 17 00:00:00 2001 From: Sergio Talens-Oliag Date: Mon, 12 Sep 2022 23:50:48 +0200 Subject: [PATCH] Build webhook with stream-command-output support. For the s3import script seems useful to print the output as it happens, as version 2.8.0 of webhook does not have this functionality we are applying the PR 549 (https://github.com/adnanh/webhook/pull/549) and building the binary for alpine. --- Dockerfile | 18 +++++++++++++++++- entrypoint.sh | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 63cdd98..473d983 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,28 @@ ARG ALPINE_VERSION + +FROM golang:alpine AS builder +LABEL maintainer="Sergio Talens-Oliag " +WORKDIR /go/src/github.com/adnanh/webhook +RUN apk update &&\ + apk add --no-cache -t build-deps curl libc-dev gcc libgcc patch &&\ + curl -L --silent -o webhook.tar.gz\ + https://github.com/adnanh/webhook/archive/2.8.0.tar.gz &&\ + tar -xzf webhook.tar.gz --strip 1 &&\ + curl -L --silent -o 549.patch\ + https://patch-diff.githubusercontent.com/raw/adnanh/webhook/pull/549.patch &&\ + patch -p1 < 549.patch &&\ + go get -d && \ + go build -o /usr/local/bin/webhook + FROM alpine:$ALPINE_VERSION LABEL maintainer="Sergio Talens-Oliag " RUN apk update &&\ - apk add --no-cache mailcap nodejs npm util-linux-misc webhook &&\ + apk add --no-cache mailcap nodejs npm util-linux-misc &&\ apk add --no-cache s3fs-fuse \ --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ &&\ rm -rf /var/cache/apk/* &&\ npm install --location=global kyso +COPY --from=builder /usr/local/bin/webhook /usr/local/bin/webhook COPY entrypoint.sh / COPY hooks/* /webhook/hooks/ EXPOSE 9000 diff --git a/entrypoint.sh b/entrypoint.sh index b03fce3..82ae798 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -99,6 +99,7 @@ print_s3import_yml() { - source: 'payload' envname: 'ORGANIZATION' name: 'import.organization' + stream-command-output: true EOF }