Apply my recent changes to nightly-modular.sh on 27 branch

This applies the same changes I recently submitted for the
nightly compose scripts to nightly-modular.sh on the 27 branch,
which is used for the Fedora-Modular 27 nightly composes. So
it makes that script include the shortname in fedmsgs and
simplifies the release variables etc. just as for the other
scripts.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2017-12-06 20:16:16 -08:00
parent 739921d234
commit 7b2477a5eb

View File

@ -10,19 +10,15 @@ NIGHTLY="--nightly"
SKIP_PHASES="--skip-phase=productimg"
DEST=$(pwd)
DATE=$(date "+%Y%m%d")
DIST="27"
BRANCHED="Modular-27"
BRANCH="branched"
SHORT="Fedora-Modular"
RELEASE="27"
RELEASE_TITLE="27"
COMPSFILE="comps-f27.xml"
GIT_BRANCH="f27"
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 <rawhide@fedoraproject.org>"
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-Modular-27/COMPOSE_ID)
OLDCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID)
# assume a releng dir is a git checkout of the releng repo
# if it does not exist clone it
@ -40,8 +36,8 @@ FEDMSG_CERTPREFIX="releng"
. ./releng/scripts/fedmsg-functions.sh
# Announce that we are starting, even though we don't know the compose_id yet..
fedmsg_json_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s"}' "$BRANCHED" "$ARCH")
send_fedmsg "${fedmsg_json_start}" ${DIST} start
fedmsg_json_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s", "short": "%s"}' "$RELEASE" "$ARCH" "$SHORT")
send_fedmsg "${fedmsg_json_start}" ${RELEASE} start
pushd $TMPDIR
git clone https://pagure.io/fedora-comps.git && {
@ -65,54 +61,54 @@ if [ "$?" != "0" ]; then
exit 1
fi
NEWCOMPOSE_ID=$(cat $TARGET_DIR/latest-Fedora-Modular-27/COMPOSE_ID)
NEWCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID)
SHORTCOMPOSE_ID=$(echo $NEWCOMPOSE_ID|sed -e 's|Fedora-Modular.*-||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
compose-changelog -p $TARGET_DIR/$NEWCOMPOSE_ID/logs/ $TARGET_DIR/$OLDCOMPOSE_ID/ $TARGET_DIR/$NEWCOMPOSE_ID/
# Figure out a version for broken deps e-mail that goes to package maintainers.
# In Rawhide it's just rawhide, for branched versions we prepend F- to the number.
if [ "$BRANCHED" = "Modular-Bikeshed" ]; then
TREENAME="$BRANCHED"
# For Bikeshed it's just bikeshed, for branched versions we prepend F- to the number.
if [ "$RELEASE" = "bikeshed" ]; then
TREENAME="$RELEASE"
else
TREENAME="F-Modular-$BRANCHED"
TREENAME="F-$RELEASE"
fi
/usr/share/mash/spam-o-matic --nomail --treename="$TREENAME" "$DESTDIR/compose/Server/" >"$DESTDIR/logs/depcheck"
# 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
# Sync the content to /pub/fedora
if [ ! -d /pub/fedora/linux/modular/development/$DIST ]; then
mkdir /pub/fedora/linux/modular/development/$DIST
if [ ! -d /pub/fedora/linux/modular/development/$RELEASE ]; then
mkdir /pub/fedora/linux/modular/development/$RELEASE
fi
$RSYNCPREFIX compose-partial-copy --arch=armhfp --arch=x86_64 --arch=aarch64 --arch=ppc64 --arch=ppc64le --arch=s390x --arch src \
"$TARGET_DIR/$NEWCOMPOSE_ID" /pub/fedora/linux/modular/development/$DIST/ \
"$TARGET_DIR/$NEWCOMPOSE_ID" /pub/fedora/linux/modular/development/$RELEASE/ \
--variant Server \
--exclude=repodata
$RSYNCPREFIX compose-partial-copy --arch=armhfp --arch=x86_64 --arch=aarch64 --arch=ppc64 --arch=ppc64le --arch=s390x --arch src \
"$TARGET_DIR/$NEWCOMPOSE_ID" /pub/fedora/linux/modular/development/$DIST/ \
"$TARGET_DIR/$NEWCOMPOSE_ID" /pub/fedora/linux/modular/development/$RELEASE/ \
--variant Server \
--delete-after
$RSYNCPREFIX rm /pub/fedora/linux/modular/development/$DIST/.composeinfo
$RSYNCPREFIX ./releng/scripts/build_composeinfo /pub/fedora/linux/modular/development/$DIST/ --name "$NEWCOMPOSE_ID"
$RSYNCPREFIX rm /pub/fedora/linux/modular/development/$RELEASE/.composeinfo
$RSYNCPREFIX ./releng/scripts/build_composeinfo /pub/fedora/linux/modular/development/$RELEASE/ --name "$NEWCOMPOSE_ID"
# 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 Modular '$DIST' compose report: '$SHORTCOMPOSE_ID' changes'
SUBJECT='Fedora Modular '$RELEASE' compose report: '$SHORTCOMPOSE_ID' changes'
for tomail in $TOMAIL ; do
cat $TARGET_DIR/$NEWCOMPOSE_ID/logs/*verbose | \
mutt -e "set from=\"$FROM\"" -e 'set envelope_from=yes' -s "$SUBJECT" $tomail
done
# Remove old composes older than 14 days
find $TARGET_DIR/Fedora-Modular-27* -xdev -depth -maxdepth 2 -mtime +14 -exec rm -rf {} \;
find $TARGET_DIR/$SHORT-$RELEASE_TITLE* -xdev -depth -maxdepth 2 -mtime +14 -exec rm -rf {} \;