toolkit/sync/minor-release-sync-to-staging.sh

89 lines
3.2 KiB
Bash
Raw Normal View History

2021-07-06 19:24:29 +00:00
#!/bin/bash
# Performs a full on sync of a minor release, directories and all. It calls the
2021-07-12 06:58:08 +00:00
# other scripts in this directory to assist where necessary.
2021-07-06 19:24:29 +00:00
# Source common variables
2021-07-06 20:33:22 +00:00
# shellcheck disable=SC2046,1091,1090
source $(dirname "$0")/common
2021-07-06 19:24:29 +00:00
2021-07-12 06:58:08 +00:00
# Major Version (eg, 8)
MAJ=${RLVER}
2021-07-06 19:24:29 +00:00
# sync all pieces of a release, including extras, nfv, etc
2021-07-12 06:58:08 +00:00
for COMPOSE in Rocky "${NONMODS_REPOS[@]}"; do
2021-11-10 19:26:09 +00:00
echo "${COMPOSE}: Syncing"
2021-07-12 06:58:08 +00:00
cd "/mnt/compose/${MAJ}/latest-${COMPOSE}-${MAJ}/compose" || { echo "${COMPOSE}: Failed to change directory"; break; }
TARGET="${STAGING_ROOT}/${CATEGORY_STUB}/${REV}"
mkdir -p "${TARGET}"
# disabling because none of our files should be starting with dashes. If they
# are something is *seriously* wrong here.
# shellcheck disable=SC2035
sudo -l && find **/* -maxdepth 0 -type d | parallel --will-cite -j 18 sudo rsync -av --chown=10004:10005 --progress --relative --human-readable \
{} "${TARGET}"
done
# sync all sig stuff
2021-11-10 19:26:09 +00:00
# Disabled as we will have a different method for sig content and sig content
# is available upstream.
#for SIG in "${!SIG_COMPOSE[@]}"; do
# echo "${SIG}: Syncing"
# cd "/mnt/compose/${MAJ}/latest-${SIG}-${MAJ}/compose" || { echo "${COMPOSE}: Failed to change directory"; break; }
#
# TARGET="${STAGING_ROOT}/${CATEGORY_STUB}/${REV}/${SIG_COMPOSE[$SIG]}"
# mkdir -p "${TARGET}"
# # disabling because none of our files should be starting with dashes. If they
# # are something is *seriously* wrong here.
# # shellcheck disable=SC2035
# sudo -l && find **/* -maxdepth 0 -type d | parallel --will-cite -j 18 sudo rsync -av --chown=10004:10005 --progress --relative --human-readable \
# {} "${TARGET}"
#done
2021-07-12 06:58:08 +00:00
# copy around the ISOs a bit, make things comfortable
for ARCH in "${ARCHES[@]}"; do
TARGET="${STAGING_ROOT}/${CATEGORY_STUB}/${REV}/isos/${ARCH}"
2021-11-10 19:26:09 +00:00
# who knows if EL10 will change the name of baseos
2021-07-12 06:58:08 +00:00
for x in BaseOS Minimal; do
2021-11-10 19:26:09 +00:00
echo "${x} ${ARCH}: Copying ISO images"
# Hardcoding this for now
SOURCE="/mnt/compose/${MAJ}/latest-Rocky-${MAJ}/compose/${x}/${ARCH}/iso"
TARGET_ARCH="${STAGING_ROOT}/${CATEGORY_STUB}/${REV}/${x}/${ARCH}/iso"
mkdir -p "${SOURCE}" "${TARGET}" "${TARGET_ARCH}"
# Copy the ISO and manifests into their target architecture
cp "${SOURCE}/*.iso*" "${TARGET_ARCH}/"
cp "${SOURCE}/CHECKSUM" "${TARGET_ARCH}/"
# Copy the ISO and manifests into the main isos target
cp "${SOURCE}/*.iso*" "${TARGET}/"
2021-07-12 06:58:08 +00:00
cat "${SOURCE}/CHECKSUM" >> "${TARGET}/CHECKSUM"
done
done
2021-08-02 23:03:51 +00:00
# make a kickstart directory
for ARCH in "${ARCHES[@]}"; do
2021-08-02 23:06:21 +00:00
for REPO in "${MODS_REPOS[@]}"; do
2021-08-02 23:03:51 +00:00
SOURCE="${STAGING_ROOT}/${CATEGORY_STUB}/${REV}/${REPO}/${ARCH}/os"
TARGET="${STAGING_ROOT}/${CATEGORY_STUB}/${REV}/${REPO}/${ARCH}/kickstart"
2021-11-10 19:26:09 +00:00
echo "Making golden kickstart directory"
2021-08-02 23:03:51 +00:00
cp -na "${SOURCE}" "${TARGET}"
done
done
2021-07-12 07:50:40 +00:00
# fix treeinfo
for ARCH in "${ARCHES[@]}"; do
2021-11-10 19:26:09 +00:00
echo "Ensuring treeinfo is correct"
2021-07-12 07:50:40 +00:00
treeinfoModder "${ARCH}"
done
2021-07-12 06:58:08 +00:00
# sign all repos
2021-11-10 19:26:09 +00:00
echo "Signing all repositories"
2021-07-12 06:58:08 +00:00
test -f $(dirname "$0")/sign-repos-only.sh
ret_val=$?
2021-07-06 19:24:29 +00:00
2021-07-12 06:58:08 +00:00
if [ "$ret_val" -eq 0 ]; then
$(dirname "$0")/sign-repos-only.sh
fi
2021-11-01 20:12:48 +00:00
# Change Symlink if required
2021-11-10 19:26:09 +00:00
echo "Setting symlink to ${REV}"
2021-11-01 20:27:41 +00:00
/bin/rm "${STAGING_ROOT}/${CATEGORY_STUB}/latest-8"
ln -sr "${STAGING_ROOT}/${CATEGORY_STUB}/${REV}" latest-8