From e0be6386be67eea7995b390e5dd039b0164c4ce2 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Jan 26 2018 11:02:39 +0000 Subject: Add 'short' key to post-release compose fedmsgs The various post-release composes - two-week Atomic, Cloud, and Docker - all send out identical fedmsgs. The other commits in this PR at least ensure the fedmsgs sent after the compose is done will have a `compose_id` key, allowing disambiguation that way, but fedmsgs sent *before* the compose is done cannot be told apart. This should solve that, without inventing new message topics: we add a `short` key to the message content which specifies the 'shortname' of the compose (e.g. Fedora-Atomic), which is how we distinguish these composes from each other. We also remove a bunch of unused variables from these files, and revise the release-related variables as explained for the master branch in #485: `$DIST`, `$BRANCH` and `$BRANCHED` are all replaced by `$RELEASE` and `$RELEASE_TITLE`. This does duplicate the value from the pungi config file, but I'm not sure it's worth figuring out a bash-y way to parse the value out of the config file just to remove this duplication. And we already effectively did this when discovering `OLDCOMPOSE_ID` and `NEWCOMPOSE_ID`, as the path used there is dependent upon the shortname; to avoid extra duplication, I've changed those to use `$SHORT-$RELEASE_TITLE`. Signed-off-by: Adam Williamson --- diff --git a/cloud-nightly.sh b/cloud-nightly.sh index ecaa714..30fb13b 100755 --- a/cloud-nightly.sh +++ b/cloud-nightly.sh @@ -12,19 +12,16 @@ NIGHTLY="" SKIP_PHASES="--skip-phase=productimg --skip-phase=pkgset --skip-phase=gather --skip-phase=extra_files --skip-phase=creatrepo" DEST=$(pwd) DATE=$(date "+%Y%m%d") -DIST="26" -BRANCHED="26" -BRANCH="branched" +# the Pungi 'shortname', which we will include in fedmsgs for disambiguation +SHORT="Fedora-Cloud" +RELEASE="26" +RELEASE_TITLE="26" COMPSFILE="comps-f26.xml" -GIT_BRANCH="f26" -TMPDIR=`mktemp -d /tmp/$DIST.$DATE.XXXX` +TMPDIR=`mktemp -d /tmp/$RELEASE.$DATE.XXXX` TOMAIL="devel@lists.fedoraproject.org test@lists.fedoraproject.org" FROM="Fedora Branched Report " RSYNCPREFIX="sudo -u ftpsync" -ATOMIC=$(mktemp -d /tmp/atomic.${DIST}.$DATE.XXXX) -ATOMICREPO="/mnt/koji/compose/atomic/$BRANCHED/" -ATOMICDEST="/mnt/koji/atomic/$BRANCHED/" -OLDCOMPOSE_ID=$(cat $TARGET_DIR/latest-Fedora-26/COMPOSE_ID) +OLDCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID) # uncomment and edit for resuming a failed compose #COMPOSE_ID="Fedora-23-20150530.n.0" # assume a releng dir is a git checkout of the releng repo @@ -37,12 +34,12 @@ 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_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s", "short": "%s"}' "$RELEASE" "$ARCH" "$SHORT") FEDMSG_MODNAME="compose" FEDMSG_CERTPREFIX="releng" . ./releng/scripts/fedmsg-functions.sh # Announce that we are starting, even though we don't know the compose_id yet.. -send_fedmsg "${fedmsg_json_start}" ${DIST} start +send_fedmsg "${fedmsg_json_start}" ${RELEASE} start pushd $TMPDIR git clone https://pagure.io/fedora-comps.git && { pushd fedora-comps @@ -62,26 +59,26 @@ if [ "$?" != "0" ]; then exit 1 fi -NEWCOMPOSE_ID=$(cat $TARGET_DIR/latest-Fedora-Cloud-26/COMPOSE_ID) +NEWCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID) SHORTCOMPOSE_ID=$(echo $NEWCOMPOSE_ID|sed -e 's|Fedora-.*-||g') -fedmsg_json_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s", "compose_id": "%s"}' "$BRANCHED" "$ARCH" "$NEWCOMPOSE_ID") -fedmsg_json_done=$(printf '{"log": "done", "branch": "%s", "arch": "%s", "compose_id": "%s"}' "$BRANCHED" "$ARCH" "$NEWCOMPOSE_ID") +fedmsg_json_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s", "short": "%s", "compose_id": "%s"}' "$RELEASE" "$ARCH" "$SHORT" "$NEWCOMPOSE_ID") +fedmsg_json_done=$(printf '{"log": "done", "branch": "%s", "arch": "%s", "short": "%s", "compose_id": "%s"}' "$RELEASE" "$ARCH" "$SHORT" "$NEWCOMPOSE_ID") # Set this to use later for a few items include depcheck DESTDIR=$TARGET_DIR/$NEWCOMPOSE_ID $RSYNCPREFIX mkdir -p $DESTDIR # Tell interested persons that the rsync is starting (zomg!) -#send_fedmsg "${fedmsg_json_start}" ${DIST} rsync.start +#send_fedmsg "${fedmsg_json_start}" ${RELEASE} rsync.start #for dir in CloudImage metadata ; # do # $RSYNCPREFIX rsync -avhH $TARGET_DIR/$NEWCOMPOSE_ID/compose/$dir/ /pub/alt/atomic/testing/$SHORTCOMPOSE_ID/$dir/ ; # done # Tell interested persons that the rsync is done. -#send_fedmsg "${fedmsg_json_done}" ${DIST} rsync.complete +#send_fedmsg "${fedmsg_json_done}" ${RELEASE} rsync.complete # Tell everyone by fedmsg about the compose -send_fedmsg "${fedmsg_json_done}" ${DIST} complete +send_fedmsg "${fedmsg_json_done}" ${RELEASE} complete # Tell everyone by email about the compose -SUBJECT='Fedora '$DIST' compose report: '$SHORTCOMPOSE_ID' changes' +SUBJECT='Fedora '$RELEASE' compose report: '$SHORTCOMPOSE_ID' changes' #for tomail in $TOMAIL ; do # cat $TARGET_DIR/$NEWCOMPOSE_ID/logs/*verbose $DESTDIR/logs/depcheck | \ # mutt -e "set from=\"$FROM\"" -e 'set envelope_from=yes' -s "$SUBJECT" $tomail diff --git a/docker-nightly.sh b/docker-nightly.sh index 0f1969c..89b7a83 100755 --- a/docker-nightly.sh +++ b/docker-nightly.sh @@ -11,19 +11,16 @@ NIGHTLY="" SKIP_PHASES="--skip-phase=productimg --skip-phase=pkgset --skip-phase=gather --skip-phase=extra_files --skip-phase=creatrepo" DEST=$(pwd) DATE=$(date "+%Y%m%d") -DIST="26" -BRANCHED="26" -BRANCH="branched" +# the Pungi 'shortname', which we will include in fedmsgs for disambiguation +SHORT="Fedora-Docker" +RELEASE="26" +RELEASE_TITLE="26" COMPSFILE="comps-f26.xml" -GIT_BRANCH="f26" -TMPDIR=`mktemp -d /tmp/$DIST.$DATE.XXXX` +TMPDIR=`mktemp -d /tmp/$RELEASE.$DATE.XXXX` TOMAIL="devel@lists.fedoraproject.org test@lists.fedoraproject.org" FROM="Fedora Branched Report " RSYNCPREFIX="sudo -u ftpsync" -ATOMIC=$(mktemp -d /tmp/atomic.${DIST}.$DATE.XXXX) -ATOMICREPO="/mnt/koji/compose/atomic/$BRANCHED/" -ATOMICDEST="/pub/fedora/linux/atomic/$BRANCHED/" -OLDCOMPOSE_ID=$(cat $TARGET_DIR/latest-Fedora_Docker-26/COMPOSE_ID) +OLDCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID) # uncomment and edit for resuming a failed compose #COMPOSE_ID="Fedora-23-20150530.n.0" # assume a releng dir is a git checkout of teh releng repo @@ -36,12 +33,12 @@ 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_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s", "short": "%s"}' "$RELEASE" "$ARCH" "$SHORT") FEDMSG_MODNAME="compose" FEDMSG_CERTPREFIX="releng" . ./releng/scripts/fedmsg-functions.sh # Announce that we are starting... -send_fedmsg "${fedmsg_json_start}" ${DIST} start +send_fedmsg "${fedmsg_json_start}" ${RELEASE} start pushd $TMPDIR git clone https://pagure.io/fedora-comps.git && { pushd fedora-comps @@ -61,26 +58,25 @@ if [ "$?" != "0" ]; then exit 1 fi -NEWCOMPOSE_ID=$(cat $TARGET_DIR/latest-Fedora-Docker-26/COMPOSE_ID) +NEWCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID) SHORTCOMPOSE_ID=$(echo $NEWCOMPOSE_ID|sed -e 's|Fedora-.*-||g') -fedmsg_json_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s", "compose_id": "%s"}' "$BRANCHED" "$ARCH" "$NEWCOMPOSE_ID") -fedmsg_json_done=$(printf '{"log": "done", "branch": "%s", "arch": "%s", "compose_id": "%s"}' "$BRANCHED" "$ARCH" "$NEWCOMPOSE_ID") +fedmsg_json_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s", "short": "%s", "compose_id": "%s"}' "$RELEASE" "$ARCH" "$SHORT" "$NEWCOMPOSE_ID") +fedmsg_json_done=$(printf '{"log": "done", "branch": "%s", "arch": "%s", "short": "%s", "compose_id": "%s"}' "$RELEASE" "$ARCH" "$SHORT" "$NEWCOMPOSE_ID") DESTDIR=$TARGET_DIR/$NEWCOMPOSE_ID $RSYNCPREFIX mkdir -p $DESTDIR # Tell interested persons that the rsync is starting (zomg!) -#send_fedmsg "${fedmsg_json_start}" ${DIST} rsync.start +#send_fedmsg "${fedmsg_json_start}" ${RELEASE} rsync.start #for dir in Docker metadata ; # do # $RSYNCPREFIX rsync -avhH $TARGET_DIR/$NEWCOMPOSE_ID/compose/$dir/ /pub/alt/atomic/testing/$SHORTCOMPOSE_ID/$dir/ ; # done # Tell interested persons that the rsync is done. -#send_fedmsg "${fedmsg_json_done}" ${DIST} rsync.complete +#send_fedmsg "${fedmsg_json_done}" ${RELEASE} rsync.complete # Tell everyone by fedmsg about the compose -send_fedmsg "${fedmsg_json_done}" ${DIST} complete -SUBJECT='Fedora '$DIST' compose report: '$SHORTCOMPOSE_ID' changes' +send_fedmsg "${fedmsg_json_done}" ${RELEASE} complete +SUBJECT='Fedora '$RELEASE' compose report: '$SHORTCOMPOSE_ID' changes' #for tomail in $TOMAIL ; do # cat $TARGET_DIR/$NEWCOMPOSE_ID/logs/*verbose $DESTDIR/logs/depcheck | \ # mutt -e "set from=\"$FROM\"" -e 'set envelope_from=yes' -s "$SUBJECT" $tomail #done - diff --git a/twoweek-nightly.sh b/twoweek-nightly.sh index 50ed064..dd3a308 100755 --- a/twoweek-nightly.sh +++ b/twoweek-nightly.sh @@ -11,19 +11,16 @@ NIGHTLY="" SKIP_PHASES="--skip-phase=productimg --skip-phase=extra_files" DEST=$(pwd) DATE=$(date "+%Y%m%d") -DIST="26" -BRANCHED="26" -BRANCH="branched" +# the Pungi 'shortname', which we will include in fedmsgs for disambiguation +SHORT="Fedora-Atomic" +RELEASE="26" +RELEASE_TITLE="26" COMPSFILE="comps-f26.xml" -GIT_BRANCH="f26" -TMPDIR=`mktemp -d /tmp/$DIST.$DATE.XXXX` +TMPDIR=`mktemp -d /tmp/$RELEASE.$DATE.XXXX` TOMAIL="devel@lists.fedoraproject.org test@lists.fedoraproject.org" FROM="Fedora Branched Report " RSYNCPREFIX="sudo -u ftpsync" -ATOMIC=$(mktemp -d /tmp/atomic.${DIST}.$DATE.XXXX) -ATOMICREPO="/mnt/koji/compose/atomic/$BRANCHED/" -ATOMICDEST="/pub/fedora/linux/atomic/$BRANCHED/" -OLDCOMPOSE_ID=$(cat $TARGET_DIR/latest-Fedora-Atomic-26/COMPOSE_ID) +OLDCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID) # uncomment and edit for resuming a failed compose #COMPOSE_ID="Fedora-23-20150530.n.0" # assume a releng dir is a git checkout of teh releng repo @@ -36,12 +33,12 @@ 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_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s", "short": "%s"}' "$RELEASE" "$ARCH" "$SHORT") FEDMSG_MODNAME="compose" FEDMSG_CERTPREFIX="releng" . ./releng/scripts/fedmsg-functions.sh # Announce that we are starting... -send_fedmsg "${fedmsg_json_start}" ${DIST} start +send_fedmsg "${fedmsg_json_start}" ${RELEASE} start pushd $TMPDIR git clone https://pagure.io/fedora-comps.git && { pushd fedora-comps @@ -61,25 +58,25 @@ if [ "$?" != "0" ]; then exit 1 fi -NEWCOMPOSE_ID=$(cat $TARGET_DIR/latest-Fedora-Atomic-26/COMPOSE_ID) +NEWCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID) SHORTCOMPOSE_ID=$(echo $NEWCOMPOSE_ID|sed -e 's|Fedora-.*-||g') -fedmsg_json_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s", "compose_id": "%s"}' "$BRANCHED" "$ARCH" "$NEWCOMPOSE_ID") -fedmsg_json_done=$(printf '{"log": "done", "branch": "%s", "arch": "%s", "compose_id": "%s"}' "$BRANCHED" "$ARCH" "$NEWCOMPOSE_ID") +fedmsg_json_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s", "short": "%s", "compose_id": "%s"}' "$RELEASE" "$ARCH" "$SHORT" "$NEWCOMPOSE_ID") +fedmsg_json_done=$(printf '{"log": "done", "branch": "%s", "arch": "%s", "short": "%s", "compose_id": "%s"}' "$RELEASE" "$ARCH" "$SHORT" "$NEWCOMPOSE_ID") DESTDIR=$TARGET_DIR/$NEWCOMPOSE_ID $RSYNCPREFIX mkdir -p $DESTDIR # Tell interested persons that the rsync is starting (zomg!) -send_fedmsg "${fedmsg_json_start}" ${DIST} rsync.start +send_fedmsg "${fedmsg_json_start}" ${RELEASE} rsync.start for dir in Atomic CloudImages Docker metadata ; do $RSYNCPREFIX rsync -avhH $TARGET_DIR/$NEWCOMPOSE_ID/compose/$dir/ /pub/alt/atomic/testing/$SHORTCOMPOSE_ID/$dir/ ; $RSYNCPREFIX ./releng/scripts/build_composeinfo /pub/alt/atomic/testing/$SHORTCOMPOSE_ID/ --name $NEWCOMPOSE_ID done # Tell interested persons that the rsync is done. -send_fedmsg "${fedmsg_json_done}" ${DIST} rsync.complete +send_fedmsg "${fedmsg_json_done}" ${RELEASE} rsync.complete # Tell everyone by fedmsg about the compose -send_fedmsg "${fedmsg_json_done}" ${DIST} complete -SUBJECT='Fedora '$DIST' compose report: '$SHORTCOMPOSE_ID' changes' +send_fedmsg "${fedmsg_json_done}" ${RELEASE} complete +SUBJECT='Fedora '$RELEASE' compose report: '$SHORTCOMPOSE_ID' changes' #for tomail in $TOMAIL ; do # cat $TARGET_DIR/$NEWCOMPOSE_ID/logs/*verbose $DESTDIR/logs/depcheck | \ # mutt -e "set from=\"$FROM\"" -e 'set envelope_from=yes' -s "$SUBJECT" $tomail