Just re-use the fedmsg definition from the releng repo.

Signed-off-by: Ralph Bean <rbean@redhat.com>
This commit is contained in:
Ralph Bean 2016-03-03 14:05:48 -05:00
parent e23a5f736d
commit d136a4cc87
2 changed files with 11 additions and 46 deletions

View File

@ -1,36 +0,0 @@
# fedmsg-functions
#
# This is a bash shell script that is meant to be sourced by other scripts
# and aims to deliver functions common to sending messages to fedmsg[0]
# in rel-eng shell scripts.
#
# [0] - http://www.fedmsg.com/en/latest/
# NOTES:
# - Scripts that source this should define at least the following:
# FEDMSG_MODNAME
# FEDMSG_CERTPREFIX
#
# Example:
#
# FEDMSG_MODNAME="compose"
# FEDMSG_CERTPREFIX="bodhi"
# source ./scripts/fedmsg-functions.sh
#
# fedmsg_json_start=$(printf '{"log": "start", "branch": "f24", "arch": "x86_64"}')
# send_fedmsg "${fedmsg_json_start}" f24 start
function send_fedmsg()
{
jsoninput="${1}"
dist="${2}"
topic="${3}"
echo ${jsoninput} | fedmsg-logger \
--cert-prefix ${FEDMSG_CERTPREFIX} \
--modname ${FEDMSG_MODNAME} \
--topic "${dist}.${topic}" \
--json-input
}

View File

@ -27,16 +27,6 @@ OLDCOMPOSE_ID=$(cat $TARGET_DIR/latest-Fedora-/COMPOSE_ID)
# uncomment and edit for resuming a failed compose
#COMPOSE_ID="Fedora-23-20150530.n.0"
# Set up our fedmsg function
fedmsg_json_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s"}' "$BRANCHED" "$ARCH")
fedmsg_json_done=$(printf '{"log": "done", "branch": "%s", "arch": "%s"}' "$BRANCHED" "$ARCH")
FEDMSG_MODNAME="compose"
FEDMSG_CERTPREFIX="releng"
. ./fedmsg-functions.sh
# Announce that we are starting...
send_fedmsg "${fedmsg_json_start}" ${DIST} start
# assume a releng dir is a git checkout of teh releng repo
# if it does not exist clone it
if [ -d releng ]; then
@ -47,6 +37,17 @@ else
git clone https://pagure.io/releng.git
fi
# Set up our fedmsg function, using the releng repo definition
fedmsg_json_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s"}' "$BRANCHED" "$ARCH")
fedmsg_json_done=$(printf '{"log": "done", "branch": "%s", "arch": "%s"}' "$BRANCHED" "$ARCH")
FEDMSG_MODNAME="compose"
FEDMSG_CERTPREFIX="releng"
. ./releng/scripts/fedmsg-functions.sh
# Announce that we are starting...
send_fedmsg "${fedmsg_json_start}" ${DIST} start
pushd $TMPDIR
git clone https://git.fedorahosted.org/git/comps.git && {
pushd comps