toolkit/sync/vault-release-no-repodata.sh

54 lines
1.7 KiB
Bash
Raw Normal View History

2023-11-13 20:21:58 +00:00
#!/bin/bash
# Syncs everything from production to vault
2023-11-16 20:59:52 +00:00
DATE="$(date +%Y%m%d%H%M%S)"
2023-11-13 20:21:58 +00:00
if [[ "$RLREL" == "lh" ]] || [[ "$RLREL" == "beta" ]]; then
echo "Lookahead nor Beta should be vaulted"
exit 1
fi
# Source common variables
# shellcheck disable=SC2046,1091,1090
source "$(dirname "$0")/common"
REV=${REVISION}
cd "${PRODUCTION_ROOT}/${CATEGORY_STUB}" || { echo "Failed to change directory"; ret_val=1; exit 1; }
ret_val=$?
if [ $ret_val -eq "0" ]; then
TARGET="${PRODUCTION_ROOT}/${VAULT_STUB}/${REV}"
mkdir -p "${TARGET}"
rsync_no_delete_prod_no_repodata "${REV}" "${TARGET}"
fi
2023-11-16 20:59:52 +00:00
if [ "$RLVER" -eq "9" ]; then
echo "copying module data"
for repo in "${MODS[@]}"; do
for arch in "${ARCHES[@]}"; do
mkdir -p "${TARGET}/${repo}/${arch}/os/repodata"
2023-11-16 22:21:56 +00:00
cp "${PRODUCTION_ROOT}/${CATEGORY_STUB}/${REV}/${repo}/${arch}/os/repodata/*MODULES.yaml.gz" "/tmp/${repo}-${arch}-${DATE}.modules.yaml.gz"
2023-11-16 20:59:52 +00:00
pushd /tmp || exit 1
gunzip "/tmp/${repo}-${arch}-${DATE}.modules.yaml.gz"
popd || exit 1
cp "/tmp/${repo}-${arch}-${DATE}.modules.yaml" "${TARGET}/${repo}/${arch}/os/repodata/"
done
done
# groups
for repo in "${MODS_REPOS[@]}"; do
for arch in "${ARCHES[@]}"; do
2023-11-16 22:21:56 +00:00
createrepo_comps "${TARGET}/${repo}/${arch}/os" "${REV}" "${PRODUCTION_ROOT}/${CATEGORY_STUB}/${REV}/${repo}/${arch}/os/repodata/*GROUPS.xml"
2023-11-16 20:59:52 +00:00
done
done
# no groups
for repo in "${NONMODS_REPOS[@]}"; do
for arch in "${ARCHES[@]}"; do
createrepo_update "${TARGET}/${repo}/${arch}/os" "${REV}"
2023-11-16 21:09:08 +00:00
createrepo_update "${TARGET}/${repo}/${arch}/debug" "${REV}"
2023-11-16 20:59:52 +00:00
done
done
fi
echo "Syncing to the vault completed. Please run the file list script."