Merge #178 Add a config and script for Rawhide done with DNF

This commit is contained in:
Dennis Gilmore 2017-03-30 17:28:01 +00:00
commit efddd81a8f
2 changed files with 63 additions and 0 deletions

10
fedora-dnf.conf Normal file
View File

@ -0,0 +1,10 @@
# The same compose as regular nightly Rawhide one, except it uses DNF and does
# not build any extra images in Koji.
from fedora import *
gather_backend = 'dnf'
# This can only be enabled once DNF 2 is used due to
# https://bugzilla.redhat.com/show_bug.cgi?id=1260986
#repoclosure_backend = 'dnf'

53
nightly-dnf.sh Executable file
View File

@ -0,0 +1,53 @@
#!/bin/sh
# Abort if any command fails or undefined variable is used.
set -eu
export LC_ALL=C
CONFIG=fedora-dnf.conf
TARGET_DIR=/mnt/koji/compose/rawhide-dnf
DATE=$(date +%Y%m%d)
COMPSDIR=$(mktemp -d "/tmp/rawhide-dnf.$DATE.XXXX")
COMPSFILE=comps-rawhide.xml
# Clone comps repo, create comps file for rawhide and copy it into current
# directory.
git clone https://pagure.io/fedora-comps.git "$COMPSDIR"
make -C "$COMPSDIR" "$COMPSFILE"
cp "$COMPSDIR/$COMPSFILE" "$(pwd)/"
rm -rf "$COMPSDIR"
# Pick yum-based compose to replicate: the one from the same day should do.
YUM_COMPOSE=/mnt/koji/compose/rawhide/Fedora-Rawhide-$DATE.n.0
# Retrieve Koji event id from it
EVENT=$(python -m json.tool <"$YUM_COMPOSE/work/global/koji-event" | grep id | tr -d -c '0-9')
# Make sure target directory exists
mkdir -p $TARGET_DIR
# Run the compose with correct event, and only use the required phases.
time pungi-koji --config="$CONFIG" --target-dir="$TARGET_DIR" --nightly --koji-event="$EVENT" \
--just-phase init --just-phase pkgset --just-phase gather --just-phase test \
--old-composes="$TARGET_DIR"
DNF_COMPOSE=$(readlink -f $TARGET_DIR/latest-Fedora-Rawhide)
# Compose was successful, let's compute differences in packages
LOG_DIR="$DNF_COMPOSE/logs/global/depsolve/"
mkdir -p "$LOG_DIR"
# For each variant.arch combination there is a separate log file. The filenames
# contain both variant UID and arch, so they are unique and can be safely
# copied into one directory.
for logfile in $YUM_COMPOSE/work/*/pungi/*.log; do
# Find path relative to compose topdir: work/<arch>/pungi/<variant>.<arch>.log
log=$(echo "$logfile" | rev | cut -d/ -f-4 | rev)
# The command exits with 1 if there are differences, so we will suppress
# that to avoid having script exit after processing first log.
pungi-compare-depsolving "$YUM_COMPOSE/$log" "$DNF_COMPOSE/$log" >"$LOG_DIR/$(basename "$log")" || true
done
# Delete composes older than 7 days.
find $TARGET_DIR -xdev -depth -maxdepth 2 -mtime +7 -exec rm -rf {} \;