#488 Apply my recent changes to nightly-modular.sh on f27 branch
Merged 6 years ago by mohanboddu. Opened 6 years ago by adamwill.
adamwill/pungi-fedora 27-nightly-fixups  into  f27

file modified
+28 -29
@@ -10,19 +10,15 @@ 

  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 @@ 

  . ./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 && {
@@ -61,55 +57,58 @@ 

  fi

  

  time $CMD "$@"

+ 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 {} \;

This just applies the changes I made to the various nightly scripts recently to nightly-modular.sh on the f27 branch, which is used for the F27 nightly modular composes that are still happening. In particular, the addition of the 'bail on failed compose' check will prevent us getting a bogus, mostly-empty compose report every time one of these composes fails. (We'll still get a mostly-empty compose report every time a compose succeeds, as the compose diffing script doesn't apparently do anything useful for modular composes, but at least we won't get so many!)

Actually, it seems like the compose diff script works fine, just there are quite often modular composes where no packages or images changed. When things do change, the mail looks less silly.

@adamwill Based on today's outcome of F27 Server Final release, I might disable this one since we might not need it anymore.

Pull-Request has been merged by mohanboddu

6 years ago
Metadata