remove comments, add hard link function

This commit is contained in:
Louis Abel 2023-05-13 13:59:58 -07:00
parent e756e71203
commit 1fa63f6967
Signed by untrusted user: label
GPG Key ID: B37E62D143879B36
7 changed files with 13 additions and 98 deletions

Binary file not shown.

View File

@ -114,6 +114,11 @@ function rsync_delete_prod() {
sudo -l && rsync -vrlptDSH --chown=10004:10005 --progress --human-readable --delete "${REV}/" "${TARGET}"
}
function perform_hardlink() {
TARGET="${1}"
hardlink -x '.*\.xml.*' "${TARGET}"
}
export -f parallel_rsync_no_delete_staging
export -f parallel_rsync_no_delete_prod
export -f parallel_rsync_delete_staging
@ -122,3 +127,4 @@ export -f rsync_no_delete_staging
export -f rsync_no_delete_prod
export -f rsync_delete_staging
export -f rsync_delete_prod
export -f perform_hardlink

View File

@ -4,7 +4,7 @@
case "${RLREL}" in
stable)
REVISION=9.2
APPEND_TO_DIR="-RC4"
APPEND_TO_DIR="-RC1"
;;
beta)
REVISION=9.3

View File

@ -17,30 +17,7 @@ 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}"
rsync_delete_prod "${REV}" "${TARGET}"
echo "Syncing to prod completed. Please run the file list script."
fi

View File

@ -17,49 +17,7 @@ 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 \
{} "${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}/" || echo { echo "Failed to change directory"; exit 1; }
#find . > fullfilelist
#if [[ -f /usr/local/bin/create-filelist ]]; then
# # We're already here, but Justin Case wanted this
# cd "${PRODUCTION_ROOT}/" || { echo "Failed to change directory"; exit 1; }
# /bin/cp fullfiletimelist-rocky fullfiletimelist-rocky-old
# /usr/local/bin/create-filelist > fullfiletimelist-rocky
# cp fullfiletimelist-rocky fullfiletimelist
#fi
## Full file list update for rocky linux itself
cd "${PRODUCTION_ROOT}/${CATEGORY_STUB}/" || { echo "Failed to change directory"; exit 1; }
## Hardlink everything except xml files
echo "Hard linking"
hardlink -x '.*\.xml.*' "${REVISION}"
#find . > fullfilelist
#if [[ -f /usr/local/bin/create-filelist ]]; then
# # We're already here, but Justin Case wanted this
# cd "${PRODUCTION_ROOT}/${CATEGORY_STUB}/" || { echo "Failed to change directory"; exit 1; }
# /bin/cp fullfiletimelist-rocky fullfiletimelist-rocky-old
# /usr/local/bin/create-filelist > fullfiletimelist-rocky
# cp fullfiletimelist-rocky fullfiletimelist
#fi
#chown 10004:10005 fullfilelist fullfiletimelist-rocky fullfiletimelist
rsync_no_delete_prod "${REV}" "${TARGET}"
echo "Syncing to prod completed. Please run the file list script."
fi

View File

@ -22,19 +22,7 @@ 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.
#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
echo "Hardlinking compose directory before syncing"
perform_hardlink "compose"
rsync_delete_staging "${TARGET}"
fi

View File

@ -23,20 +23,6 @@ if [ $ret_val -eq "0" ]; then
TARGET="${STAGING_ROOT}/${CATEGORY_STUB}/${REV}"
mkdir -p "${TARGET}"
rsync_no_delete_staging "${TARGET}"
# disabling because none of our files should be starting with dashes. If they
# are something is *seriously* wrong here.
#sudo -l && find **/* -maxdepth 0 -type d | parallel --will-cite -j 18 sudo rsync -av --chown=10004:10005 --progress --relative --human-readable \
# {} "${TARGET}"
# This is temporary until we implement rsync into empanadas
#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}"
# fi
# fi
echo "Hardlinking staging directory"
perform_hardlink "${TARGET}"
fi