dockerfiles/xmpp-ci/entrypoint.sh

56 lines
884 B
Bash

#!/bin/sh
USERNAME="${USERNAME:-${PLUGIN_USERNAME}}"
if [ -z "$USERNAME" ]; then
echo "'username' must specified"
exit 1
fi
PASSWORD="${PASSWORD:-${PLUGIN_PASSWORD}}"
if [ -z "$PASSWORD" ]; then
echo "'password' must specified"
exit 1
fi
RECIPIENT="${RECIPIENT:-${PLUGIN_RECIPIENT}}"
if [ -z "$RECIPIENT" ]; then
echo "'recipient' must specified"
exit 1
fi
em () {
echo "_${1}_"
}
monospace () {
echo '`'"${1}"'`'
}
strong () {
echo "*${1}*"
}
strike () {
echo "~${1}~"
}
build_line () {
echo "$1: $2"
}
message () {
echo status: "${CI_BUILD_STATUS}"
echo repo: "${CI_REPO_NAME}"
echo branch: "${CI_REPO_DEFAULT_BRANCH}"
echo ""
echo commit msg:
echo "${CI_COMMIT_MESSAGE}"
}
message
message | \
go-sendxmpp \
--username="${USERNAME}"\
--password="${PASSWORD}" \
"${RECIPIENT}"