From ff232bac771b293d9896444f7753c0145a2726e5 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Jan 25 2018 13:29:36 +0000 Subject: Emit 'location' key in fedmsgs, pointing to compose URL For fedmsg_meta we have to provide a 'link'. At present we do this with a rather large and icky pile of conditionals which doesn't work properly. It's much simpler to figure out the URL in the compose script and emit it in the fedmsg, then meta can just...use it. For older fedmsgs we'll just point to the base kojipkgs location for the link. For synced composes, we use the synced URL on dl (this matches what the meta stuff tried to do before). For non-synced composes we just use the kojipkgs location. Signed-off-by: Adam Williamson --- diff --git a/cloud-nightly.sh b/cloud-nightly.sh index 65780e4..2e3f1b8 100755 --- a/cloud-nightly.sh +++ b/cloud-nightly.sh @@ -61,11 +61,15 @@ fi NEWCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID) SHORTCOMPOSE_ID=$(echo $NEWCOMPOSE_ID|sed -e 's|Fedora-.*-||g') -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 +# 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") + $RSYNCPREFIX mkdir -p $DESTDIR # Tell interested persons that the rsync is starting (zomg!) #send_fedmsg "${fedmsg_json_start}" ${RELEASE} rsync.start diff --git a/docker-nightly.sh b/docker-nightly.sh index 0fd1bb1..7e9f291 100755 --- a/docker-nightly.sh +++ b/docker-nightly.sh @@ -60,10 +60,15 @@ fi NEWCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID) SHORTCOMPOSE_ID=$(echo $NEWCOMPOSE_ID|sed -e 's|Fedora-.*-||g') -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 +# 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") + $RSYNCPREFIX mkdir -p $DESTDIR # Tell interested persons that the rsync is starting (zomg!) #send_fedmsg "${fedmsg_json_start}" ${RELEASE} rsync.start diff --git a/nightly-modular.sh b/nightly-modular.sh index 95498f1..9c3b103 100755 --- a/nightly-modular.sh +++ b/nightly-modular.sh @@ -18,6 +18,7 @@ TMPDIR=`mktemp -d /tmp/$RELEASE.$DATE.XXXX` TOMAIL="devel@lists.fedoraproject.org test@lists.fedoraproject.org" FROM="Fedora Branched Report " RSYNCPREFIX="sudo -u ftpsync" +RSYNCTARGET="/pub/fedora/linux/modular/development/$RELEASE" OLDCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID) # assume a releng dir is a git checkout of the releng repo @@ -63,11 +64,14 @@ fi 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", "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 +# Public URL the synced compose will wind up at, we put it in fedmsgs +LOCATION="https://dl.fedoraproject.org/$RSYNCTARGET" +# 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") 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. @@ -83,19 +87,19 @@ fi send_fedmsg "${fedmsg_json_start}" ${RELEASE} rsync.start # Sync the content to /pub/fedora -if [ ! -d /pub/fedora/linux/modular/development/$RELEASE ]; then - mkdir /pub/fedora/linux/modular/development/$RELEASE +if [ ! -d "$RSYNCTARGET" ]; then + mkdir "$RSYNCTARGET" 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/$RELEASE/ \ + "$TARGET_DIR/$NEWCOMPOSE_ID" "$RSYNCTARGET/" \ --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/$RELEASE/ \ + "$TARGET_DIR/$NEWCOMPOSE_ID" "$RSYNCTARGET/" \ --variant Server \ --delete-after -$RSYNCPREFIX rm /pub/fedora/linux/modular/development/$RELEASE/.composeinfo -$RSYNCPREFIX ./releng/scripts/build_composeinfo /pub/fedora/linux/modular/development/$RELEASE/ --name "$NEWCOMPOSE_ID" +$RSYNCPREFIX rm "$RSYNCTARGET/.composeinfo" +$RSYNCPREFIX ./releng/scripts/build_composeinfo "$RSYNCTARGET/" --name "$NEWCOMPOSE_ID" # Tell interested persons that the rsync is done. send_fedmsg "${fedmsg_json_done}" ${RELEASE} rsync.complete diff --git a/twoweek-nightly.sh b/twoweek-nightly.sh index bb80e14..bab977c 100755 --- a/twoweek-nightly.sh +++ b/twoweek-nightly.sh @@ -20,6 +20,7 @@ TMPDIR=`mktemp -d /tmp/$RELEASE.$DATE.XXXX` TOMAIL="devel@lists.fedoraproject.org test@lists.fedoraproject.org" FROM="Fedora Branched Report " RSYNCPREFIX="sudo -u ftpsync" +RSYNCTARGET="/pub/alt/atomic/testing/$SHORTCOMPOSE_ID" OLDCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID) # uncomment and edit for resuming a failed compose #COMPOSE_ID="Fedora-23-20150530.n.0" @@ -60,17 +61,21 @@ fi NEWCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID) SHORTCOMPOSE_ID=$(echo $NEWCOMPOSE_ID|sed -e 's|Fedora-.*-||g') -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") DESTDIR=$TARGET_DIR/$NEWCOMPOSE_ID +# Public URL the synced compose will wind up at, we put it in fedmsgs +LOCATION="https://dl.fedoraproject.org/$RSYNCTARGET" +# 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") + $RSYNCPREFIX mkdir -p $DESTDIR # Tell interested persons that the rsync is starting (zomg!) send_fedmsg "${fedmsg_json_start}" ${RELEASE} rsync.start for dir in Atomic CloudImages Docker metadata ; do - $RSYNCPREFIX rsync -avhH $TARGET_DIR/$NEWCOMPOSE_ID/compose/$dir/ /pub/alt/atomic/testing/$SHORTCOMPOSE_ID/$dir/ ; - $RSYNCPREFIX ./releng/scripts/build_composeinfo /pub/alt/atomic/testing/$SHORTCOMPOSE_ID/ --name $NEWCOMPOSE_ID + $RSYNCPREFIX rsync -avhH $TARGET_DIR/$NEWCOMPOSE_ID/compose/$dir/ "$RSYNCTARGET/$dir/" ; + $RSYNCPREFIX ./releng/scripts/build_composeinfo "$RSYNCTARGET/" --name $NEWCOMPOSE_ID done # Tell interested persons that the rsync is done. send_fedmsg "${fedmsg_json_done}" ${RELEASE} rsync.complete