From 7de82ba61293754c3ab16102b75ff9e4c37ecf53 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Oct 29 2019 06:30:04 +0000 Subject: f31: add sync-release.sh for f31 Signed-off-by: Peter Robinson --- diff --git a/sync-release.sh b/sync-release.sh new file mode 100755 index 0000000..7da939f --- /dev/null +++ b/sync-release.sh @@ -0,0 +1,53 @@ +#!/bin/sh +set -x +export LC_ALL=C +LABEL=$1 +# Remove the label from arguments. It gets special treatment. Other arguments +# to the script are passed to pungi-koji directly. +shift +CONFIG="fedora-iot.conf" +TARGET_DIR="/mnt/koji/compose/iot" +NIGHTLY="" +DEST=$(pwd) +DATE=$(date "+%Y%m%d") +# the Pungi 'shortname', which we will include in fedmsgs for disambiguation +SHORT="Fedora-IoT" +RELEASE="31" +RELEASE_TITLE="31" +COMPSFILE="comps-f31.xml" +TMPDIR=`mktemp -d /tmp/$RELEASE.$DATE.XXXX` +TOMAIL="iot@lists.fedoraproject.org" +FROM="Fedora IoT Report " +RSYNCPREFIX="sudo -u ftpsync" +RSYNCTARGET="/pub/alt/iot/31/" +OLDCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID) + +NEWCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID) +SHORTCOMPOSE_ID=$(echo $NEWCOMPOSE_ID|sed -e 's|Fedora-.*-||g') + +DESTDIR=$TARGET_DIR/$NEWCOMPOSE_ID +# Public URL the synced compose will wind up at, we put it in fedmsgs +LOCATION="https://dl.fedoraproject.org$RSYNCTARGET" +# Update fedmsg template +#fedmsg_json_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s", "short": "%s", "compose_id": "%s", "location": "%s"}' "$RELEASE" "$ARCH" "$SHORT" "$NEWCOMPOSE_ID", "$LOCATION") +#fedmsg_json_done=$(printf '{"log": "done", "branch": "%s", "arch": "%s", "short": "%s", "compose_id": "%s", "location": "%s"}' "$RELEASE" "$ARCH" "$SHORT" "$NEWCOMPOSE_ID" "$LOCATION") + +$RSYNCPREFIX mkdir -p $DESTDIR +# Tell interested persons that the rsync is starting (zomg!) +#send_fedmsg "${fedmsg_json_start}" ${RELEASE} rsync.start +for dir in IoT metadata ; + do + $RSYNCPREFIX rsync -avhH --delete-after $DESTDIR/compose/$dir/ "$RSYNCTARGET/$dir/" ; + $RSYNCPREFIX ./releng/scripts/build_composeinfo "$RSYNCTARGET/" --name $NEWCOMPOSE_ID + done +# Tell interested persons that the rsync is done. +#send_fedmsg "${fedmsg_json_done}" ${RELEASE} rsync.complete +# Tell everyone by fedmsg about the compose +#send_fedmsg "${fedmsg_json_done}" ${RELEASE} complete +#SUBJECT='Fedora IoT'$RELEASE' compose report: '$SHORTCOMPOSE_ID' changes' +#for tomail in $TOMAIL ; do +# cat $DESTDIR/logs/*verbose $DESTDIR/logs/depcheck | \ +# mutt -e "set from=\"$FROM\"" -e 'set envelope_from=yes' -s "$SUBJECT" $tomail +#done + +#find $TARGET_DIR -xdev -depth -maxdepth 2 -mtime +14 -name Fedora-IoT-${RELEASE}\* -exec rm -rf {} \;