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`
|
|
|
|
MOCK="/usr/bin/mock"
|
|
|
|
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/"
|
|
|
|
ATOMICDEST="/pub/fedora/linux/atomic/$BRANCHED/"
|
2016-02-27 14:49:01 +00:00
|
|
|
OLDCOMPOSE_ID=$(cat $TARGET_DIR/latest-Fedora-/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-02-29 22:22:42 +00:00
|
|
|
# assume a releng dir is a git checkout of teh releng repo
|
|
|
|
# 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_json_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s"}' "$BRANCHED" "$ARCH")
|
|
|
|
fedmsg_json_done=$(printf '{"log": "done", "branch": "%s", "arch": "%s"}' "$BRANCHED" "$ARCH")
|
|
|
|
FEDMSG_MODNAME="compose"
|
|
|
|
FEDMSG_CERTPREFIX="releng"
|
|
|
|
. ./releng/scripts/fedmsg-functions.sh
|
|
|
|
|
|
|
|
# Announce that we are starting...
|
|
|
|
send_fedmsg "${fedmsg_json_start}" ${DIST} start
|
|
|
|
|
|
|
|
|
2015-12-08 15:15:29 +00:00
|
|
|
pushd $TMPDIR
|
|
|
|
git clone https://git.fedorahosted.org/git/comps.git && {
|
|
|
|
pushd comps
|
|
|
|
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-02-29 04:20:37 +00:00
|
|
|
if [ "$?" = "0" ]; then
|
|
|
|
export mail=0
|
|
|
|
fi
|
|
|
|
|
2016-02-27 14:49:01 +00:00
|
|
|
NEWCOMPOSE_ID=$(cat $TARGET_DIR/latest-Fedora-/COMPOSE_ID)
|
2016-02-27 03:18:42 +00:00
|
|
|
SHORTCOMPOSE_ID=$(echo $NEWCOMPOSE_ID|sed -e 's|Fedora-.*-||g')
|
2016-02-23 22:34:37 +00:00
|
|
|
|
|
|
|
DESTDIR=$TARGET_DIR/$NEWCOMPOSE_ID
|
|
|
|
MOCKCONFIG="fedora-${DIST}-compose-x86_64"
|
|
|
|
$MOCK -r $MOCKCONFIG --uniqueext=$DATE --init
|
|
|
|
$MOCK -r $MOCKCONFIG --uniqueext=$DATE --install lorax rpm-ostree git
|
|
|
|
$MOCK -r $MOCKCONFIG --uniqueext=$DATE --shell "mkdir -p ${DESTDIR}/compose/Atomic/x86_64/iso"
|
|
|
|
$MOCK -r $MOCKCONFIG --uniqueext=$DATE --shell ""
|
|
|
|
$MOCK -r $MOCKCONFIG --uniqueext=$DATE --shell "if [ ! -d $ATOMICREPO ]; then ostree init --repo=$ATOMICREPO --mode=archive-z2;fi"
|
|
|
|
$MOCK -r $MOCKCONFIG --uniqueext=$DATE --shell "git clone https://git.fedorahosted.org/git/fedora-atomic.git $ATOMIC && pushd $ATOMIC && git log -n 1 --pretty='%h: %ci - %s' && git checkout ${GIT_BRANCH}"
|
2016-02-27 03:18:42 +00:00
|
|
|
$MOCK -r $MOCKCONFIG --uniqueext=$DATE --shell "cd $ATOMIC && sed -i -e 's|mirrorlist=.*$|baseurl=http://kojipkgs.fedoraproject.org/compose/$BRANCH/$NEWCOMPOSE_ID/compose/Everything/x86_64/os/|g' fedora*repo"
|
2016-02-23 22:34:37 +00:00
|
|
|
$MOCK -r $MOCKCONFIG --uniqueext=$DATE --shell "rpm-ostree compose tree --repo=$ATOMICREPO $ATOMIC/fedora-atomic-docker-host.json >$logdir/atomic"
|
|
|
|
|
2016-03-02 23:46:26 +00:00
|
|
|
$MOCK -r $MOCKCONFIG --uniqueext=$DATE --shell "lorax --nomacboot -p Fedora -v ${BRANCHED} -r ${SHORTCOMPOSE_ID} \
|
2016-02-27 03:18:42 +00:00
|
|
|
-s http://kojipkgs.fedoraproject.org/compose/$BRANCH/$NEWCOMPOSE_ID/compose/Everything/x86_64/os/ \
|
2016-02-23 22:34:37 +00:00
|
|
|
-i fedora-productimg-atomic \
|
|
|
|
-t Atomic \
|
|
|
|
--tmp /tmp/ \
|
|
|
|
--logfile=${DESTDIR}/logs/x86_64/atomic \
|
|
|
|
--add-template /spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl \
|
|
|
|
--add-template-var=ostree_osname=fedora-atomic \
|
2016-03-02 23:46:26 +00:00
|
|
|
--add-arch-template-var=ostree_repo=https://kojipkgs.fedoraproject.org/compose/atomic/$BRANCHED/ \
|
|
|
|
--add-template-var=ostree_ref=fedora-atomic/${BRANCHED}/x86_64/docker-host \
|
2016-02-23 22:34:37 +00:00
|
|
|
--add-arch-template /spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl \
|
|
|
|
--add-arch-template-var=ostree_osname=fedora-atomic \
|
2016-03-02 23:46:26 +00:00
|
|
|
--add-arch-template-var=ostree_ref=fedora-atomic/${BRANCHED}/x86_64/docker-host \
|
2016-02-23 22:34:37 +00:00
|
|
|
${DESTDIR}/compose/Atomic/x86_64/os/ "
|
2016-03-02 23:46:26 +00:00
|
|
|
$MOCK -r $MOCKCONFIG --uniqueext=$DATE --shell "cp -l ${DESTDIR}/compose/Atomic/x86_64/os/images/boot.iso ${DESTDIR}/compose/Atomic/x86_64/iso/Fedora-Atomic-x86_64-${BRANCHED}-${DATE}.iso"
|
|
|
|
$MOCK -r $MOCKCONFIG --uniqueext=$DATE --shell "pushd ${DESTDIR}/compose/Atomic/x86_64/iso/ ;sha256sum -b --tag *iso >Fedora-Atomic-${BRANCHED}-x86_64-CHECKSUM; popd"
|
2016-02-23 22:34:37 +00:00
|
|
|
$MOCK -r $MOCKCONFIG --uniqueext=$DATE --clean
|
|
|
|
|
|
|
|
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-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
|
|
|
|
|
|
|
for dir in Everything Atomic CloudImages Docker Server Spins Workstation ;
|
|
|
|
do
|
2016-02-27 03:18:42 +00:00
|
|
|
$RSYNCPREFIX rsync -avhH $TARGET_DIR/$NEWCOMPOSE_ID/compose/$dir/ /pub/fedora/linux/development/$DIST/$dir/ --link-dest=/pub/fedora/linux/development/$DIST/Everything/ --exclude=repodata ;
|
|
|
|
$RSYNCPREFIX rsync -avhH $TARGET_DIR/$NEWCOMPOSE_ID/compose/$dir/ /pub/fedora/linux/development/$DIST/$dir/ --link-dest=/pub/fedora/linux/development/$DIST/Everything/ --delete-after ;
|
2016-02-27 03:08:35 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
for dir in Cloud Labs ;
|
|
|
|
do
|
2016-02-27 03:18:42 +00:00
|
|
|
$RSYNCPREFIX rsync -avhH $TARGET_DIR/$NEWCOMPOSE_ID/compose/$dir/ /pub/alt/development/$DIST/$dir/ --link-dest=/pub/fedora/linux/development/$DIST/Everything/ --exclude=repodata ;
|
|
|
|
$RSYNCPREFIX rsync -avhH $TARGET_DIR/$NEWCOMPOSE_ID/compose/$dir/ /pub/alt/development/$DIST/$dir/ --link-dest=/pub/fedora/linux/development/$DIST/Everything/ --delete-after ;
|
2016-02-27 03:08:35 +00:00
|
|
|
done
|
|
|
|
|
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-02-23 22:34:37 +00:00
|
|
|
if [ "$mail" = "0" ]; then
|
2016-03-03 15:18:36 +00:00
|
|
|
for tomail in $TOMAIL ; do
|
2016-02-29 22:22:42 +00:00
|
|
|
cat $TARGET_DIR/$NEWCOMPOSE_ID/logs/*verbose $DESTDIR/logs/depcheck | \
|
2016-02-23 22:34:37 +00:00
|
|
|
mutt -e "set from=\"$FROM\"" -e 'set envelope_from=yes' -s "$SUBJECT" $tomail
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
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
|
|
|
|
./releng/scripts/srpm-excluded-arch.py -a $arches --path $DESTDIR/compose/Everything/source/tree/SRPMS/\*/ >$DESTDIR/logs/excludearch-$koji.log
|
|
|
|
done
|
|
|
|
|