add rsync that does not sync repodata

This commit is contained in:
Louis Abel 2023-11-13 13:21:58 -07:00
parent 6cfae3af98
commit 48be209c64
Signed by untrusted user: label
GPG Key ID: B37E62D143879B36
4 changed files with 55 additions and 1 deletions

View File

@ -159,6 +159,12 @@ function rsync_no_delete_prod() {
sudo -l && rsync -vrlptDSHog --chown=10004:10005 --progress --human-readable "${REV}/" "${TARGET}" sudo -l && rsync -vrlptDSHog --chown=10004:10005 --progress --human-readable "${REV}/" "${TARGET}"
} }
function rsync_no_delete_prod_no_repodata() {
local REV="${1}"
local TARGET="${2}"
sudo -l && rsync -vrlptDSHog --chown=10004:10005 --progress --human-readable --exclude repodata "${REV}/" "${TARGET}"
}
function rsync_delete_staging() { function rsync_delete_staging() {
local TARGET="${1}" local TARGET="${1}"
sudo -l && rsync -vrlptDSHog --chown=10004:10005 --progress --human-readable --delete compose/ "${TARGET}" sudo -l && rsync -vrlptDSHog --chown=10004:10005 --progress --human-readable --delete compose/ "${TARGET}"
@ -303,6 +309,7 @@ export -f parallel_rsync_delete_prod
export -f rsync_no_delete_staging export -f rsync_no_delete_staging
export -f rsync_no_delete_staging_with_excludes export -f rsync_no_delete_staging_with_excludes
export -f rsync_no_delete_prod export -f rsync_no_delete_prod
export -f rsync_no_delete_prod_no_repodata
export -f rsync_delete_staging export -f rsync_delete_staging
export -f rsync_delete_staging_with_excludes export -f rsync_delete_staging_with_excludes
export -f rsync_delete_prod export -f rsync_delete_prod

23
sync/sync-to-vault.sh Normal file
View File

@ -0,0 +1,23 @@
#!/bin/bash
# Syncs everything from staging to production
if [[ "$RLREL" == "lh" ]] || [[ "$RLREL" == "beta" ]]; then
exit 1
fi
# Source common variables
# shellcheck disable=SC2046,1091,1090
source "$(dirname "$0")/common"
REV=${REVISION}${APPEND_TO_DIR}
cd "${STAGING_ROOT}/${CATEGORY_STUB}" || { echo "Failed to change directory"; ret_val=1; exit 1; }
ret_val=$?
if [ $ret_val -eq "0" ]; then
TARGET="${PRODUCTION_ROOT}/${CATEGORY_STUB}/${REV/-*/}"
mkdir -p "${TARGET}"
rsync_delete_prod "${REV}" "${TARGET}"
echo "Syncing to prod completed. Please run the file list script."
fi

View File

@ -0,0 +1,24 @@
#!/bin/bash
# Syncs everything from production to vault
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}"
echo "Syncing to the vault completed. Please run the file list script."
fi

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Syncs everything from staging to production # Syncs everything from production to vault
if [[ "$RLREL" == "lh" ]] || [[ "$RLREL" == "beta" ]]; then if [[ "$RLREL" == "lh" ]] || [[ "$RLREL" == "beta" ]]; then
echo "Lookahead nor Beta should be vaulted" echo "Lookahead nor Beta should be vaulted"