Initial commit

This commit is contained in:
PapaTutuWawa 2023-08-18 23:04:55 +02:00
commit bd51cb6b0d
2 changed files with 26 additions and 0 deletions

8
Dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM alpine:3.18.3
# We need bash for parameter arrays
RUN apk add --no-cache go-sendxmpp bash
# Include the main script
ADD --chmod=555 entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

18
entrypoint.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
if [[ "${WOODPECKER_BUILD_STATUS}" = "success" ]]; then
MESSAGE="✔️ Build for ${WOODPECKER_COMMIT_SHA} on ${WOODPECKER_REPO_OWNER}/${WOODPECKER_REPO_NAME} succeeded."
else
MESSAGE="❌ Build for ${WOODPECKER_COMMIT_SHA} on ${WOODPECKER_REPO_OWNER}/${WOODPECKER_REPO_NAME} failed.\nSee ${WOODPECKER_BUILD_LINK}"
fi
SERVER_DETAILS=""
if [[ ! -z "${PLUGIN_XMPP_SERVER}" ]]; then
SERVER_DETAILS=(-j "${PLUGIN_XMPP_SERVER}")
fi
SERVER_TLS=""
if [[ ! -z "${PLUGIN_XMPP_TLS}" ]]; then
SERVER_TLS=--tls
fi
echo -e "$MESSAGE" | go-sendxmpp -u ${PLUGIN_XMPP_JID} -p ${PLUGIN_XMPP_PASSWORD} ${SERVER_DETAILS[@]} ${SERVER_TLS} -a 2B -c ${PLUGIN_XMPP_MUC}