#! /bin/bash # # check-compose # # rawhide/branched/rc # # examples: # check-compose --rc 1.3 --index 1 --yesterday = check RC 1.3 compose started yesterday as the second run # check-compose --today = check rawhide compose started today mode=rawhide rel=32 num=0 while test -n "$1" do case "$1" in --help) echo "$(basename $0) [--rawhide] [--rc val] [--index num] []" exit 0 ;; --branched) mode=branched shift ;; --rawhide) mode=rawhide shift ;; --rc) mode=rc shift rc=$1 shift ;; --index) shift num=$1 shift ;; --today) date=$(date --date="today" +%Y%m%d) shift ;; --yesterday) date=$(date --date="yesterday" +%Y%m%d) shift ;; *) date=$1 shift ;; esac done if [ -z "${date}" ]; then date=$(date --date="yesterday" +%Y%m%d) fi echo -n "Using mode=${mode}, date=${date}, " if [ "${mode}" = "rc" ]; then echo "RC ${rc}" dir=${rel} suffix=${num} # final RC is x.y and creates 32-1.1 while Beta is Beta-x.y and creates 32_Beta-1.1 if [[ "${rc}" =~ ^[0-9]\.[0-9]$ ]]; then stamp=${rel}-${rc} else stamp=${rel}_${rc} fi else echo "nightly" if [ "${mode}" = "rawhide" ]; then dir=rawhide rel=Rawhide else dir=branched fi suffix=n.${num} stamp=${rel}-${date}.${suffix} fi topurl=https://kojipkgs.fedoraproject.org/compose/${dir}/Fedora-${rel}-${date}.${suffix} url=${topurl}/compose/ arches="aarch64 ppc64le s390x" sb_arches="aarch64 ppc64le" result() { [ $1 -eq 0 ] && echo OK || echo MISSING } state=$(wget -q -O - ${topurl}/STATUS) echo "compose URL=${topurl}, status is ${state}" echo echo "Checking Everything" for a in ${arches} do image=Fedora-Everything-netinst-${a}-${stamp}.iso echo -n "${image}..." wget --spider -q ${url}/Everything/${a}/iso/${image} result $? done echo echo "Checking Server" for a in ${arches} do for i in dvd netinst do image=Fedora-Server-${i}-${a}-${stamp}.iso echo -n "${image}..." wget --spider -q ${url}/Server/${a}/iso/${image} result $? done done echo echo "Checking Cloud" for a in ${arches} do image=Fedora-Cloud-Base-${stamp}.${a}.qcow2 echo -n "${image}..." wget --spider -q ${url}/Cloud/${a}/images/${image} result $? done echo echo "Checking Container" for a in ${arches} do for i in Base Minimal-Base do image=Fedora-Container-${i}-${stamp}.${a}.tar.xz echo -n "${image}..." wget --spider -q ${url}/Container/${a}/images/${image} result $? done done echo echo "Checking Silverblue" for a in ${sb_arches} do image=Fedora-Silverblue-ostree-${a}-${stamp}.iso echo -n "${image}..." wget --spider -q ${url}/Silverblue/${a}/iso/${image} result $? done echo echo "Checking Workstation Live" for a in ppc64le do image=Fedora-Workstation-Live-${a}-${stamp}.iso echo -n "${image}..." wget --spider -q ${url}/Workstation/${a}/iso/${image} result $? done