diff --git a/func/common/.imports.sh.swp b/func/common/.imports.sh.swp deleted file mode 100644 index d2de4b4..0000000 Binary files a/func/common/.imports.sh.swp and /dev/null differ diff --git a/sync/common b/sync/common index e4b0dc5..e909ecd 100644 --- a/sync/common +++ b/sync/common @@ -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 diff --git a/sync/common_9 b/sync/common_9 index 1557053..0439448 100644 --- a/sync/common_9 +++ b/sync/common_9 @@ -4,7 +4,7 @@ case "${RLREL}" in stable) REVISION=9.2 - APPEND_TO_DIR="-RC4" + APPEND_TO_DIR="-RC1" ;; beta) REVISION=9.3 diff --git a/sync/sync-to-prod.delete.sh b/sync/sync-to-prod.delete.sh index 9058255..1268c7a 100644 --- a/sync/sync-to-prod.delete.sh +++ b/sync/sync-to-prod.delete.sh @@ -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 diff --git a/sync/sync-to-prod.sh b/sync/sync-to-prod.sh index da92f66..2faa360 100644 --- a/sync/sync-to-prod.sh +++ b/sync/sync-to-prod.sh @@ -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 diff --git a/sync/sync-to-staging.delete.sh b/sync/sync-to-staging.delete.sh index 902c91a..857317c 100644 --- a/sync/sync-to-staging.delete.sh +++ b/sync/sync-to-staging.delete.sh @@ -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 diff --git a/sync/sync-to-staging.sh b/sync/sync-to-staging.sh index 2775835..8ecadc5 100644 --- a/sync/sync-to-staging.sh +++ b/sync/sync-to-staging.sh @@ -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