2015-05-29 20:04:00 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
|
|
export LC_ALL=C
|
|
|
|
|
|
|
|
CONFIG="fedora.conf"
|
2015-07-07 15:14:06 +00:00
|
|
|
TARGET_DIR="/mnt/koji/compose/rawhide"
|
2015-05-29 20:04:00 +00:00
|
|
|
#OLD_COMPOSES_DIR="--old-composes=/mnt/fedora_koji/compose/f23 --old-composes=$TARGET_DIR"
|
|
|
|
NIGHTLY="--nightly"
|
2015-07-24 18:09:00 +00:00
|
|
|
SKIP_PHASES="--skip-phase=productimg"
|
2015-12-08 15:15:29 +00:00
|
|
|
DEST=$(pwd)
|
|
|
|
DATE=$(date "+%Y%m%d")
|
2016-02-23 22:34:37 +00:00
|
|
|
DIST="rawhide"
|
2016-02-27 03:18:42 +00:00
|
|
|
BRANCHED="rawhide"
|
2016-02-23 22:34:37 +00:00
|
|
|
BRANCH="rawhide"
|
|
|
|
COMPSFILE="comps-rawhide.xml"
|
|
|
|
GIT_BRANCH="master"
|
|
|
|
TMPDIR=`mktemp -d /tmp/$DIST.$DATE.XXXX`
|
|
|
|
TOMAIL="devel@lists.fedoraproject.org test@lists.fedoraproject.org"
|
|
|
|
FROM="Fedora Rawhide Report <rawhide@fedoraproject.org>"
|
|
|
|
RSYNCPREFIX="sudo -u ftpsync"
|
|
|
|
ATOMIC=$(mktemp -d /tmp/atomic.${DIST}.$DATE.XXXX)
|
|
|
|
ATOMICREPO="/mnt/koji/compose/atomic/$BRANCHED/"
|
2016-05-16 19:39:41 +00:00
|
|
|
ATOMICDEST="/mnt/koji/atomic/$BRANCHED/"
|
2016-06-27 00:57:04 +00:00
|
|
|
OLDCOMPOSE_ID=$(cat $TARGET_DIR/latest-Fedora-Rawhide/COMPOSE_ID)
|
2015-05-29 20:04:00 +00:00
|
|
|
# uncomment and edit for resuming a failed compose
|
|
|
|
#COMPOSE_ID="Fedora-23-20150530.n.0"
|
|
|
|
|
2016-03-14 12:35:14 +00:00
|
|
|
# assume a releng dir is a git checkout of the releng repo
|
2016-02-29 22:22:42 +00:00
|
|
|
# if it does not exist clone it
|
|
|
|
if [ -d releng ]; then
|
|
|
|
pushd releng
|
|
|
|
git pull --rebase
|
|
|
|
popd
|
|
|
|
else
|
|
|
|
git clone https://pagure.io/releng.git
|
|
|
|
fi
|
|
|
|
|
2016-03-03 19:05:48 +00:00
|
|
|
# Set up our fedmsg function, using the releng repo definition
|
|
|
|
FEDMSG_MODNAME="compose"
|
|
|
|
FEDMSG_CERTPREFIX="releng"
|
|
|
|
. ./releng/scripts/fedmsg-functions.sh
|
|
|
|
|
2016-04-25 16:11:45 +00:00
|
|
|
# Announce that we are starting, even though we don't know the compose_id yet..
|
2016-05-16 21:00:44 +00:00
|
|
|
send_fedmsg "${fedmsg_json_start}" ${DIST} start
|
2016-03-03 19:05:48 +00:00
|
|
|
|
2015-12-08 15:15:29 +00:00
|
|
|
pushd $TMPDIR
|
2016-05-13 22:32:43 +00:00
|
|
|
git clone https://pagure.io/fedora-comps.git && {
|
2016-05-14 13:37:21 +00:00
|
|
|
pushd fedora-comps
|
2015-12-08 15:15:29 +00:00
|
|
|
make "${COMPSFILE}"
|
|
|
|
cp "${COMPSFILE}" $DEST/
|
|
|
|
popd
|
|
|
|
}
|
|
|
|
popd
|
|
|
|
|
2016-02-29 22:22:42 +00:00
|
|
|
./releng/scripts/block_retired.py
|
2016-02-23 22:34:37 +00:00
|
|
|
|
2015-12-04 19:58:19 +00:00
|
|
|
CMD="pungi-koji --notification-script=/usr/bin/pungi-fedmsg-notification --config=$CONFIG --old-composes=$TARGET_DIR $OLD_COMPOSES_DIR $NIGHTLY $SKIP_PHASES"
|
2015-07-24 18:09:00 +00:00
|
|
|
|
2015-05-29 20:04:00 +00:00
|
|
|
if [ -z "$COMPOSE_ID" ]; then
|
|
|
|
CMD="$CMD --target-dir=$TARGET_DIR"
|
|
|
|
else
|
2015-07-24 18:09:00 +00:00
|
|
|
CMD="$CMD --debug-mode --compose-dir=$TARGET_DIR/$COMPOSE_ID"
|
2015-05-29 20:04:00 +00:00
|
|
|
fi
|
|
|
|
|
2015-07-24 18:09:00 +00:00
|
|
|
time $CMD "$@"
|
2016-08-12 07:50:17 +00:00
|
|
|
if [ "$?" != "0" ]; then
|
|
|
|
exit 1
|
2016-02-29 04:20:37 +00:00
|
|
|
fi
|
|
|
|
|
2016-06-27 00:57:04 +00:00
|
|
|
NEWCOMPOSE_ID=$(cat $TARGET_DIR/latest-Fedora-Rawhide/COMPOSE_ID)
|
2016-02-27 03:18:42 +00:00
|
|
|
SHORTCOMPOSE_ID=$(echo $NEWCOMPOSE_ID|sed -e 's|Fedora-.*-||g')
|
2016-04-25 16:11:45 +00:00
|
|
|
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")
|
2016-02-23 22:34:37 +00:00
|
|
|
|
2016-04-27 15:53:24 +00:00
|
|
|
# Set this to use later for a few items include depcheck
|
|
|
|
DESTDIR=$TARGET_DIR/$NEWCOMPOSE_ID
|
|
|
|
|
2016-02-23 22:34:37 +00:00
|
|
|
compose-changelog -p $TARGET_DIR/$NEWCOMPOSE_ID/logs/ $TARGET_DIR/$OLDCOMPOSE_ID/ $TARGET_DIR/$NEWCOMPOSE_ID/
|
2016-02-29 22:22:42 +00:00
|
|
|
/usr/share/mash/spam-o-matic $DESTDIR/compose/Everything/ >$DESTDIR/logs/depcheck
|
|
|
|
|
|
|
|
[ -z "$ARCH" ] && {
|
|
|
|
./releng/scripts/critpath.py --url file://$DESTDIR/compose/Everything -o $DESTDIR/logs/critpath.txt branched &> $DESTDIR/logs/critpath.log
|
|
|
|
}
|
2016-02-23 22:34:37 +00:00
|
|
|
|
2016-05-17 00:37:41 +00:00
|
|
|
ostree prune --repo=$ATOMICREPO --keep-younger-than="14 days ago" --refs-only
|
|
|
|
|
2016-03-03 18:04:11 +00:00
|
|
|
# Tell interested persons that the rsync is starting (zomg!)
|
|
|
|
send_fedmsg "${fedmsg_json_start}" ${DIST} rsync.start
|
2016-02-27 03:08:35 +00:00
|
|
|
|
2016-08-18 08:21:05 +00:00
|
|
|
$RSYNCPREFIX compose-partial-copy "$TARGET_DIR/$NEWCOMPOSE_ID" /pub/fedora/linux/development/$DIST/ \
|
|
|
|
--variant Everything --variant Atomic --variant CloudImages --variant Docker --variant Server --variant Spins --variant Workstation \
|
|
|
|
--link-dest=/pub/fedora/linux/development/$DIST/Everything --exclude=repodata
|
|
|
|
$RSYNCPREFIX compose-partial-copy "$TARGET_DIR/$NEWCOMPOSE_ID" /pub/fedora/linux/development/$DIST/ \
|
|
|
|
--variant Everything --variant Atomic --variant CloudImages --variant Docker --variant Server --variant Spins --variant Workstation \
|
|
|
|
--link-dest=/pub/fedora/linux/development/$DIST/Everything --delete-after
|
|
|
|
$RSYNCPREFIX rm /pub/fedora/linux/development/$DIST/.composeinfo
|
|
|
|
$RSYNCPREFIX ./releng/scripts/build_composeinfo /pub/fedora/linux/development/$DIST/ --name "$NEWCOMPOSE_ID"
|
|
|
|
|
|
|
|
$RSYNCPREFIX compose-partial-copy "$TARGET_DIR/$NEWCOMPOSE_ID" /pub/alt/development/$DIST/ \
|
|
|
|
--variant Cloud --variant Labs \
|
|
|
|
--link-dest=/pub/fedora/linux/development/$DIST/Everything/ --exclude=repodata
|
|
|
|
$RSYNCPREFIX compose-partial-copy "$TARGET_DIR/$NEWCOMPOSE_ID" /pub/alt/development/$DIST/ \
|
|
|
|
--variant Cloud --variant Labs \
|
|
|
|
--link-dest=/pub/fedora/linux/development/$DIST/Everything/ --delete-after
|
|
|
|
$RSYNCPREFIX rm /pub/alt/development/$DIST/.composeinfo
|
|
|
|
$RSYNCPREFIX ./releng/scripts/build_composeinfo /pub/alt/development/$DIST/ --name "$NEWCOMPOSE_ID"
|
|
|
|
|
2016-03-12 00:49:25 +00:00
|
|
|
$RSYNCPREFIX rsync -avhH --delete-after $ATOMICREPO $ATOMICDEST
|
2016-02-27 03:08:35 +00:00
|
|
|
|
2016-03-03 18:04:11 +00:00
|
|
|
# Tell interested persons that the rsync is done.
|
|
|
|
send_fedmsg "${fedmsg_json_done}" ${DIST} rsync.complete
|
|
|
|
|
|
|
|
# Tell everyone by fedmsg about the compose
|
|
|
|
send_fedmsg "${fedmsg_json_done}" ${DIST} complete
|
|
|
|
|
|
|
|
# Tell everyone by email about the compose
|
2016-02-29 04:29:17 +00:00
|
|
|
SUBJECT='Fedora '$DIST' compose report: '$SHORTCOMPOSE_ID' changes'
|
2016-08-12 07:50:17 +00:00
|
|
|
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
|
2016-02-23 22:34:37 +00:00
|
|
|
|
2016-02-29 22:22:42 +00:00
|
|
|
for koji in arm ppc s390
|
|
|
|
do
|
|
|
|
if [ "$koji" = "arm" ]; then
|
|
|
|
arches=aarch64
|
|
|
|
elif [ "$koji" = "ppc" ]; then
|
|
|
|
arches=ppc64,ppc64le
|
|
|
|
elif [ "$koji" = "s390" ]; then
|
|
|
|
arches=s390,s390x
|
|
|
|
fi
|
2016-09-14 02:58:46 +00:00
|
|
|
./releng/scripts/srpm-excluded-arch.py -a $arches --path $DESTDIR/compose/Everything/source/tree/Packages/\*/ >$DESTDIR/logs/excludearch-$koji.log
|
2016-02-29 22:22:42 +00:00
|
|
|
done
|
|
|
|
|
2016-05-27 19:00:17 +00:00
|
|
|
find $TARGET_DIR -xdev -depth -maxdepth 2 -mtime +14 -exec rm -rf {} \;
|
2016-05-17 00:46:41 +00:00
|
|
|
|