forked from sig_core/toolkit
general sync script cleanup
This commit is contained in:
parent
047287e464
commit
ebeff58040
@ -51,6 +51,7 @@ ALL_REPOS=(
|
||||
|
||||
NONSIG_COMPOSE=(
|
||||
Rocky
|
||||
Extras
|
||||
Rocky-devel
|
||||
Plus
|
||||
)
|
||||
|
@ -21,6 +21,12 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
|
||||
sudo -l && find **/* -maxdepth 0 -type d | parallel --will-cite -j 18 sudo rsync -av --chown=10004:10005 --progress --relative --human-readable \
|
||||
{} "${TARGET}"
|
||||
|
||||
if [[ "${COMPOSE}" == "Rocky" ]]; then
|
||||
cp COMPOSE_ID "${TARGET}"
|
||||
chown 10004:10005 "${TARGET}/COMPOSE_ID"
|
||||
rsync -av --chown=10004:10005 --progress --relative --human-readable metadata "${TARGET}"
|
||||
fi
|
||||
|
||||
# Return back to where we started
|
||||
popd || { echo "${COMPOSE}: Failed to change back"; break; }
|
||||
done
|
||||
|
42
sync/sync-to-prod.delete.sh
Normal file
42
sync/sync-to-prod.delete.sh
Normal file
@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
# Syncs everything from staging to production
|
||||
|
||||
# Source common variables
|
||||
# shellcheck disable=SC2046,1091,1090
|
||||
source "$(dirname "$0")/common"
|
||||
|
||||
REV=${REVISION}${APPEND_TO_DIR}
|
||||
|
||||
cd "${STAGING_ROOT}/${CATEGORY_STUB}/${REV}" || { echo "Failed to change directory"; ret_val=1; exit 1; }
|
||||
ret_val=$?
|
||||
|
||||
if [ $ret_val -eq "0" ]; then
|
||||
TARGET="${PRODUCTION_ROOT}/${CATEGORY_STUB}/${REV:0:3}"
|
||||
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 ./ -mindepth 1 -maxdepth 1 -type d -exec find {}/ -mindepth 1 -maxdepth 1 -type d \;|sed 's/^..//g' | parallel --will-cite -j 18 sudo rsync -av --chown=10004:10005 --progress --relative --human-readable --delete \
|
||||
{} "${TARGET}"
|
||||
# shellcheck disable=SC2035
|
||||
sudo -l && find ** -maxdepth 0 -type l | parallel --will-cite -j 18 sudo rsync -av --chown=10004:10005 --progress --relative --human-readable \
|
||||
{} "${TARGET}"
|
||||
|
||||
# Temporary until empanadas has this support
|
||||
if [ -f "COMPOSE_ID" ]; then
|
||||
cp COMPOSE_ID "${TARGET}"
|
||||
chown 10004:10005 "${TARGET}/COMPOSE_ID"
|
||||
fi
|
||||
|
||||
if [ -d "metadata" ]; then
|
||||
rsync -av --chown=10004:10005 --progress --relative --human-readable metadata "${TARGET}"
|
||||
fi
|
||||
|
||||
# Full file list update for production root
|
||||
cd "${PRODUCTION_ROOT}/${CATEGORY_STUB}/" || { echo "Failed to change directory"; exit 1; }
|
||||
## Hardlink everything except xml files
|
||||
echo "Hard linking"
|
||||
hardlink -x '.*\.xml.*' "${REVISION}"
|
||||
echo "Syncing to prod completed. Please run the file list script."
|
||||
fi
|
||||
|
38
sync/sync-to-staging.delete.sh
Normal file
38
sync/sync-to-staging.delete.sh
Normal file
@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Source common variables
|
||||
# shellcheck disable=SC2046,1091,1090
|
||||
source "$(dirname "$0")/common"
|
||||
|
||||
if [[ $# -eq 0 ]]; then
|
||||
echo "You must specify a short name."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Major Version (eg, 8)
|
||||
MAJ=${RLVER}
|
||||
# Short name (eg, NFV, extras, Rocky, gluster9)
|
||||
SHORT=${1}
|
||||
|
||||
cd "/mnt/compose/${MAJ}/latest-${SHORT}-${MAJ}/compose" || { echo "Failed to change directory"; ret_val=1; exit 1; }
|
||||
ret_val=$?
|
||||
|
||||
if [ $ret_val -eq "0" ]; then
|
||||
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 --delete \
|
||||
{} "${TARGET}"
|
||||
|
||||
# This is temporary until we implement rsync into empanadas
|
||||
if [ -f "COMPOSE_ID" ]; then
|
||||
cp COMPOSE_ID "${TARGET}"
|
||||
chown 10004:10005 "${TARGET}/COMPOSE_ID"
|
||||
fi
|
||||
|
||||
if [ -d "metadata" ]; then
|
||||
rsync -av --chown=10004:10005 --progress --relative --human-readable metadata "${TARGET}"
|
||||
fi
|
||||
fi
|
@ -27,12 +27,14 @@ if [ $ret_val -eq "0" ]; then
|
||||
{} "${TARGET}"
|
||||
|
||||
# This is temporary until we implement rsync into empanadas
|
||||
if [ -f "COMPOSE_ID" ]; then
|
||||
cp COMPOSE_ID "${TARGET}"
|
||||
chown 10004:10005 "${TARGET}/COMPOSE_ID"
|
||||
fi
|
||||
if [[ "${COMPOSE}" == "Rocky" ]]; then
|
||||
if [ -f "COMPOSE_ID" ]; then
|
||||
cp COMPOSE_ID "${TARGET}"
|
||||
chown 10004:10005 "${TARGET}/COMPOSE_ID"
|
||||
fi
|
||||
|
||||
if [ -d "metadata" ]; then
|
||||
rsync -av --chown=10004:10005 --progress --relative --human-readable metadata "${TARGET}"
|
||||
if [ -d "metadata" ]; then
|
||||
rsync -av --chown=10004:10005 --progress --relative --human-readable metadata "${TARGET}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user