make xmpp image more ci-specific

Ricard Illa 2022-08-23 15:07:02 +02:00
parent 20ba0467d1
commit 6f4329f002
No known key found for this signature in database
GPG Key ID: F69A672B72E54902
5 changed files with 58 additions and 34 deletions

View File

@ -1,7 +1,7 @@
REGISTRY=registry.monotremata.xyz
PLATFORMS=linux/amd64,linux/arm64
IMAGES=agate buildx-qemu mpd pleroma rainloop rsync sendxmpp static-page-builder tor transmission webdav
IMAGES=agate buildx-qemu mpd pleroma rainloop rsync xmpp-ci static-page-builder tor transmission webdav
.PHONY: all $(IMAGES)
@ -27,7 +27,7 @@ rainloop:
rsync:
$(BUILDX)
sendxmpp:
xmpp-ci:
$(BUILDX)
static-page-builder:

View File

@ -1,31 +0,0 @@
#!/bin/sh
MESSAGE="${MESSAGE:-${PLUGIN_MESSAGE}}"
if [ -z "$MESSAGE" ]; then
echo "'message' must specified"
exit 1
fi
USERNAME="${USERNAME:-${PLUGIN_USERNAME}}"
if [ -z "$USERNAME" ]; then
echo "'username' must specified"
exit 1
fi
PASSWORD="${PASSWORD:-${PLUGIN_PASSWORD}}"
if [ -z "$USERNAME" ]; then
echo "'username' must specified"
exit 1
fi
RECIPIENT="${RECIPIENT:-${PLUGIN_RECIPIENT}}"
if [ -z "$RECIPIENT" ]; then
echo "'recipient' must specified"
exit 1
fi
exec echo "$MESSAGE" | \
go-sendxmpp \
--username="${USERNAME}"\
--password="${PASSWORD}" \
"${RECIPIENT}"

View File

@ -1,4 +1,4 @@
IMG_NAME=sendxmpp
IMG_NAME=xmpp-ci
REGISTRY=registry.monotremata.xyz
IMG=$(REGISTRY)/$(IMG_NAME)
PLATFORMS=linux/amd64,linux/arm64

55
xmpp-ci/entrypoint.sh Normal file
View File

@ -0,0 +1,55 @@
#!/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 repo: "${CI_REPO_NAME}"
echo status: "${CI_BUILD_STATUS}"
echo branch: "${CI_REPO_DEFAULT_BRANCH}"
echo ""
echo commit msg:
echo "${CI_COMMIT_MESSAGE}"
}
message
message | \
go-sendxmpp \
--username="${USERNAME}"\
--password="${PASSWORD}" \
"${RECIPIENT}"