From a9747db338003b874901f05a8a8a788e56494295 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 17 Feb 2019 11:17:02 +0800 Subject: [PATCH] feat: add docker container. --- Dockerfile | 22 ++++++++++++++++++++++ entrypoint.sh | 7 +++++++ 2 files changed, 29 insertions(+) create mode 100644 Dockerfile create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..193f775 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM golang:1.11 + +# Github labels +LABEL "com.github.actions.name"="Action Telegram" +LABEL "com.github.actions.description"="Sending a Telegram notification message" +LABEL "com.github.actions.icon"="message-square" +LABEL "com.github.actions.color"="blue" + +LABEL "repository"="https://github.com/Ilshidur/actions" +LABEL "homepage"="https://github.com/appleboy/telegram-action" +LABEL "maintainer"="Bo-Yi Wu " +LABEL "version"="0.0.1" + +ENV TELEGRAM_VERSION=1.4.0 +ENV OS_ARCH=linux-amd64 + +RUN wget https://github.com/appleboy/drone-telegram/releases/download/${TELEGRAM_VERSION}/drone-telegram-${TELEGRAM_VERSION}-${OS_ARCH} -O /bin/drone-telegram +RUN chmod +x /bin/drone-telegram + +ADD entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..4ca058b --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -eu + +export TELEGRAM_MESSAGE=$? + +/bin/drone-telegram