From 1915cf2a27d11473beb3df09f1b193a13ebacb9d Mon Sep 17 00:00:00 2001 From: nazunalika Date: Wed, 10 Nov 2021 16:48:10 -0700 Subject: [PATCH 1/5] shellcheck --- sync/minor-release-sync-to-staging.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sync/minor-release-sync-to-staging.sh b/sync/minor-release-sync-to-staging.sh index 3d894bc..55bd7b4 100644 --- a/sync/minor-release-sync-to-staging.sh +++ b/sync/minor-release-sync-to-staging.sh @@ -90,4 +90,4 @@ echo "Setting symlink to ${REV}" pushd "${STAGING_ROOT}/${CATEGORY_STUB}" /bin/rm "${STAGING_ROOT}/${CATEGORY_STUB}/latest-8" ln -sr "${STAGING_ROOT}/${CATEGORY_STUB}/${REV}" latest-8 -popd +popd || exit From 2d0b95d15851038f7d3c0ee333e163b6c838d3b1 Mon Sep 17 00:00:00 2001 From: nazunalika Date: Wed, 10 Nov 2021 16:51:32 -0700 Subject: [PATCH 2/5] Rocky is used twice --- sync/minor-release-sync-to-staging.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sync/minor-release-sync-to-staging.sh b/sync/minor-release-sync-to-staging.sh index 55bd7b4..ae7e8a3 100644 --- a/sync/minor-release-sync-to-staging.sh +++ b/sync/minor-release-sync-to-staging.sh @@ -9,7 +9,7 @@ source $(dirname "$0")/common MAJ=${RLVER} # sync all pieces of a release, including extras, nfv, etc -for COMPOSE in Rocky "${NONSIG_COMPOSE[@]}"; do +for COMPOSE in "${NONSIG_COMPOSE[@]}"; do echo "${COMPOSE}: Syncing" cd "/mnt/compose/${MAJ}/latest-${COMPOSE}-${MAJ}/compose" || { echo "${COMPOSE}: Failed to change directory"; break; } From a977a8b5ba9d51cf1720fbdfe64609414ac82973 Mon Sep 17 00:00:00 2001 From: nazunalika Date: Wed, 10 Nov 2021 16:51:59 -0700 Subject: [PATCH 3/5] Rocky is used twice and shellcheck --- sync/minor-release-sync-to-staging.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sync/minor-release-sync-to-staging.sh b/sync/minor-release-sync-to-staging.sh index ae7e8a3..ea7f844 100644 --- a/sync/minor-release-sync-to-staging.sh +++ b/sync/minor-release-sync-to-staging.sh @@ -87,7 +87,7 @@ fi # Change Symlink if required echo "Setting symlink to ${REV}" -pushd "${STAGING_ROOT}/${CATEGORY_STUB}" +pushd "${STAGING_ROOT}/${CATEGORY_STUB}" || exit /bin/rm "${STAGING_ROOT}/${CATEGORY_STUB}/latest-8" ln -sr "${STAGING_ROOT}/${CATEGORY_STUB}/${REV}" latest-8 popd || exit From 8918a2b398dd602e9e4626e12d34a05d516f8e70 Mon Sep 17 00:00:00 2001 From: nazunalika Date: Wed, 10 Nov 2021 16:56:31 -0700 Subject: [PATCH 4/5] go back to where we started please --- sync/minor-release-sync-to-staging.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sync/minor-release-sync-to-staging.sh b/sync/minor-release-sync-to-staging.sh index ea7f844..410125d 100644 --- a/sync/minor-release-sync-to-staging.sh +++ b/sync/minor-release-sync-to-staging.sh @@ -20,8 +20,12 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do # 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 \ {} "${TARGET}" + + # Return back to where we started + cd "$(dirname "$0")" || { echo "${COMPOSE}: Failed to change back"; break; } done + # sync all sig stuff # Disabled as we will have a different method for sig content and sig content # is available upstream. From a0187dbf6494bbc67829b6256b43fd1920396595 Mon Sep 17 00:00:00 2001 From: nazunalika Date: Wed, 10 Nov 2021 16:57:42 -0700 Subject: [PATCH 5/5] try pushd --- sync/minor-release-sync-to-staging.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sync/minor-release-sync-to-staging.sh b/sync/minor-release-sync-to-staging.sh index 410125d..a8bfb5f 100644 --- a/sync/minor-release-sync-to-staging.sh +++ b/sync/minor-release-sync-to-staging.sh @@ -11,7 +11,7 @@ MAJ=${RLVER} # sync all pieces of a release, including extras, nfv, etc for COMPOSE in "${NONSIG_COMPOSE[@]}"; do echo "${COMPOSE}: Syncing" - cd "/mnt/compose/${MAJ}/latest-${COMPOSE}-${MAJ}/compose" || { echo "${COMPOSE}: Failed to change directory"; break; } + pushd "/mnt/compose/${MAJ}/latest-${COMPOSE}-${MAJ}/compose" || { echo "${COMPOSE}: Failed to change directory"; break; } TARGET="${STAGING_ROOT}/${CATEGORY_STUB}/${REV}" mkdir -p "${TARGET}" @@ -22,7 +22,7 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do {} "${TARGET}" # Return back to where we started - cd "$(dirname "$0")" || { echo "${COMPOSE}: Failed to change back"; break; } + popd "$(dirname "$0")" || { echo "${COMPOSE}: Failed to change back"; break; } done