2017-02-24 14:13:04 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#set -x
|
|
|
|
export LC_ALL=C
|
|
|
|
LABEL=$1
|
2017-07-24 12:44:12 +00:00
|
|
|
# Remove the label from arguments. It gets special treatment. Other arguments
|
|
|
|
# to the script are passed to pungi-koji directly.
|
|
|
|
shift
|
2017-02-24 14:13:04 +00:00
|
|
|
CONFIG="fedora-cloud.conf"
|
2018-01-26 13:23:31 +00:00
|
|
|
TARGET_DIR="/mnt/koji/compose"
|
2017-02-24 14:13:04 +00:00
|
|
|
#OLD_COMPOSES_DIR="--old-composes=/mnt/fedora_koji/compose/f23 --old-composes=$TARGET_DIR"
|
|
|
|
NIGHTLY=""
|
|
|
|
SKIP_PHASES="--skip-phase=productimg --skip-phase=pkgset --skip-phase=gather --skip-phase=extra_files --skip-phase=creatrepo"
|
|
|
|
DEST=$(pwd)
|
|
|
|
DATE=$(date "+%Y%m%d")
|
2018-01-24 19:59:52 +00:00
|
|
|
# the Pungi 'shortname', which we will include in fedmsgs for disambiguation
|
|
|
|
SHORT="Fedora-Cloud"
|
|
|
|
RELEASE="27"
|
|
|
|
RELEASE_TITLE="27"
|
|
|
|
COMPSFILE="comps-f27.xml"
|
|
|
|
TMPDIR=`mktemp -d /tmp/$RELEASE.$DATE.XXXX`
|
2017-02-24 14:13:04 +00:00
|
|
|
TOMAIL="devel@lists.fedoraproject.org test@lists.fedoraproject.org"
|
|
|
|
FROM="Fedora Branched Report <rawhide@fedoraproject.org>"
|
|
|
|
RSYNCPREFIX="sudo -u ftpsync"
|
2018-01-24 19:59:52 +00:00
|
|
|
OLDCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID)
|
2017-02-24 14:13:04 +00:00
|
|
|
# uncomment and edit for resuming a failed compose
|
|
|
|
#COMPOSE_ID="Fedora-23-20150530.n.0"
|
|
|
|
# assume a releng dir is a git checkout of the 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
|
|
|
|
# Set up our fedmsg function, using the releng repo definition
|
2018-01-24 19:59:52 +00:00
|
|
|
fedmsg_json_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s", "short": "%s"}' "$RELEASE" "$ARCH" "$SHORT")
|
2017-02-24 14:13:04 +00:00
|
|
|
FEDMSG_MODNAME="compose"
|
|
|
|
FEDMSG_CERTPREFIX="releng"
|
|
|
|
. ./releng/scripts/fedmsg-functions.sh
|
|
|
|
# Announce that we are starting, even though we don't know the compose_id yet..
|
2018-01-24 19:59:52 +00:00
|
|
|
send_fedmsg "${fedmsg_json_start}" ${RELEASE} start
|
2017-02-24 14:13:04 +00:00
|
|
|
pushd $TMPDIR
|
|
|
|
git clone https://pagure.io/fedora-comps.git && {
|
|
|
|
pushd fedora-comps
|
|
|
|
make "${COMPSFILE}"
|
|
|
|
cp "${COMPSFILE}" $DEST/
|
|
|
|
popd
|
|
|
|
}
|
|
|
|
popd
|
|
|
|
CMD="pungi-koji --notification-script=/usr/bin/pungi-fedmsg-notification --config=$CONFIG --old-composes=$TARGET_DIR $OLD_COMPOSES_DIR $NIGHTLY $SKIP_PHASES --label=$LABEL"
|
|
|
|
if [ -z "$COMPOSE_ID" ]; then
|
|
|
|
CMD="$CMD --target-dir=$TARGET_DIR"
|
|
|
|
else
|
|
|
|
CMD="$CMD --debug-mode --compose-dir=$TARGET_DIR/$COMPOSE_ID"
|
|
|
|
fi
|
|
|
|
time $CMD "$@"
|
2018-01-24 19:59:52 +00:00
|
|
|
if [ "$?" != "0" ]; then
|
|
|
|
exit 1
|
2017-02-24 14:13:04 +00:00
|
|
|
fi
|
2018-01-24 19:59:52 +00:00
|
|
|
|
|
|
|
NEWCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID)
|
2017-02-24 14:13:04 +00:00
|
|
|
SHORTCOMPOSE_ID=$(echo $NEWCOMPOSE_ID|sed -e 's|Fedora-.*-||g')
|
2018-01-24 19:59:52 +00:00
|
|
|
|
2017-02-24 14:13:04 +00:00
|
|
|
# Set this to use later for a few items include depcheck
|
|
|
|
DESTDIR=$TARGET_DIR/$NEWCOMPOSE_ID
|
2018-01-25 10:00:52 +00:00
|
|
|
# Public URL the compose will wind up at, we put it in fedmsgs
|
|
|
|
LOCATION=$(echo $DESTDIR|sed -e 's,/mnt/koji,https://kojipkgs.fedoraproject.org,g')
|
|
|
|
# Update fedmsg template
|
|
|
|
fedmsg_json_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s", "short": "%s", "compose_id": "%s", "location": "%s"}' "$RELEASE" "$ARCH" "$SHORT" "$NEWCOMPOSE_ID", "$LOCATION")
|
|
|
|
fedmsg_json_done=$(printf '{"log": "done", "branch": "%s", "arch": "%s", "short": "%s", "compose_id": "%s", "location": "%s"}' "$RELEASE" "$ARCH" "$SHORT" "$NEWCOMPOSE_ID" "$LOCATION")
|
|
|
|
|
2017-02-24 14:13:04 +00:00
|
|
|
$RSYNCPREFIX mkdir -p $DESTDIR
|
|
|
|
# Tell interested persons that the rsync is starting (zomg!)
|
2018-01-24 19:59:52 +00:00
|
|
|
#send_fedmsg "${fedmsg_json_start}" ${RELEASE} rsync.start
|
2017-02-24 14:13:04 +00:00
|
|
|
#for dir in CloudImage metadata ;
|
|
|
|
# do
|
2018-01-25 11:12:21 +00:00
|
|
|
# $RSYNCPREFIX rsync -avhH $DESTDIR/compose/$dir/ /pub/alt/atomic/testing/$SHORTCOMPOSE_ID/$dir/ ;
|
2017-02-24 14:13:04 +00:00
|
|
|
# done
|
|
|
|
# Tell interested persons that the rsync is done.
|
2018-01-24 19:59:52 +00:00
|
|
|
#send_fedmsg "${fedmsg_json_done}" ${RELEASE} rsync.complete
|
2017-02-24 14:13:04 +00:00
|
|
|
# Tell everyone by fedmsg about the compose
|
2018-01-24 19:59:52 +00:00
|
|
|
send_fedmsg "${fedmsg_json_done}" ${RELEASE} complete
|
2017-02-24 14:13:04 +00:00
|
|
|
# Tell everyone by email about the compose
|
2018-01-24 19:59:52 +00:00
|
|
|
SUBJECT='Fedora '$RELEASE' compose report: '$SHORTCOMPOSE_ID' changes'
|
|
|
|
#for tomail in $TOMAIL ; do
|
2018-01-25 11:12:21 +00:00
|
|
|
# cat $DESTDIR/logs/*verbose $DESTDIR/logs/depcheck | \
|
2018-01-24 19:59:52 +00:00
|
|
|
# mutt -e "set from=\"$FROM\"" -e 'set envelope_from=yes' -s "$SUBJECT" $tomail
|
|
|
|
#done
|