woodpecker-xmpp/entrypoint.sh

19 lines
600 B
Bash
Raw Normal View History

2023-08-18 21:04:55 +00:00
#!/bin/bash
2023-08-19 10:59:33 +00:00
if [[ "${CI_BUILD_STATUS}" = "success" ]]; then
MESSAGE="✔️ Build for ${CI_COMMIT_SHA} on ${CI_REPO} succeeded."
2023-08-18 21:04:55 +00:00
else
2023-08-19 10:59:33 +00:00
MESSAGE="❌ Build for ${CI_COMMIT_SHA} on ${CI_REPO} failed on ${CI_MACHINE} (${CI_SYSTEM_ARCH}).\nSee ${CI_BUILD_LINK}"
2023-08-18 21:04:55 +00:00
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}