Skip to content

Commit 5d0f85b

Browse files
committed
undo devel move; ensure release syncs are almost consistent
1 parent 075f05c commit 5d0f85b

File tree

3 files changed

+84
-16
lines changed

3 files changed

+84
-16
lines changed

sync/beta-release-sync-to-staging.sh

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ source $(dirname "$0")/common
1111
# Major Version (eg, 8)
1212
MAJ=${RLVER}
1313

14-
if [[ "${RLVER}" -eq "9" ]]; then
15-
echo "Invalid release"
16-
exit 1
17-
fi
18-
1914
# sync all pieces of a release, including extras, nfv, etc
2015
for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
2116
echo "${COMPOSE}: Syncing"
@@ -31,6 +26,10 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
3126
# Sort the ISO's
3227
for ARCH in "${ARCHES[@]}"; do
3328
for x in "${ISO_TYPES[@]}"; do
29+
if [[ "${x}" != "BaseOS" ]]; then
30+
echo "${x} ${ARCH}: Removing unnecessary boot image"
31+
/bin/rm -v "${x}/${ARCH}/iso/Rocky-${REVISION}-20"*"${ARCH}"*.iso
32+
fi
3433
## Check if the ISO even exists, if not skip
3534
if ls "${x}/${ARCH}/iso/"*.iso 1> /dev/null 2>&1; then
3635
echo "${x} ${ARCH}: Moving ISO images"
@@ -42,6 +41,18 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
4241
test -d "${x}/${ARCH}/iso" && rmdir "${x}/${ARCH}/iso"
4342
done
4443
pushd "isos/${ARCH}" || { echo "${ARCH}: Failed to change directory"; break; }
44+
45+
echo "Symlinking to 'latest' if ISO exists"
46+
test -f "Rocky-${REVISION}-${ARCH}-boot.iso" && ln -s "Rocky-${REVISION}-${ARCH}-boot.iso" "Rocky-${MAJ}-latest-${ARCH}-boot.iso"
47+
test -f "Rocky-${REVISION}-${ARCH}-dvd.iso" && ln -s "Rocky-${REVISION}-${ARCH}-dvd.iso" "Rocky-${MAJ}-latest-${ARCH}-dvd.iso"
48+
test -f "Rocky-${REVISION}-${ARCH}-dvd1.iso" && ln -s "Rocky-${REVISION}-${ARCH}-dvd1.iso" "Rocky-${MAJ}-latest-${ARCH}-dvd.iso"
49+
test -f "Rocky-${REVISION}-${ARCH}-minimal.iso" && ln -s "Rocky-${REVISION}-${ARCH}-minimal.iso" "Rocky-${MAJ}-latest-${ARCH}-minimal.iso"
50+
echo "(Re)generating manifests"
51+
for file in *.iso; do
52+
xorriso -dev "${file}" --find | tail -n+2 | tr -d "'" | cut -c2- | sort > "${file}.manifest"
53+
done
54+
55+
# ISO checksums
4556
for file in *.iso; do
4657
printf "# %s: %s bytes\n%s\n" \
4758
"${file}" \
@@ -50,10 +61,56 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
5061
| sudo tee -a "${file}.CHECKSUM"
5162
done
5263
cat ./*.CHECKSUM > CHECKSUM
64+
# GPG sign the checksums
5365
popd || { echo "Could not change directory"; break; }
5466
done
5567
# Sort the cloud images here. Probably just a directory move, make some checksums (unless they're already there)
68+
for ARCH in "${ARCHES[@]}"; do
69+
echo "${ARCH}: Sorting cloud images"
70+
if [ -d "images/${ARCH}" ]; then
71+
pushd "images/${ARCH}" || { echo "${ARCH}: Failed to change directory"; break; }
72+
mv images/* .
73+
rmdir images
74+
test -f CHECKSUM && /bin/rm CHECKSUM
75+
# Drop vagrant from name if they are there
76+
echo "${ARCH}: Looking for vagrant names and dropping them"
77+
for x in * ; do if [[ "${x}" =~ "vagrant" ]]; then mv "${x}" $(echo ${x} | sed 's/\.vagrant\..*\(\.box\)/\1/g') ; fi ; done
78+
# Generate "latest" links
79+
for x in * ; do ln -s "${x}" $(echo "${x}" | sed -E "s/-$REVISION-[0-9]+\.[0-9]+/.latest/g ; s/\.oci//g") ; done
80+
# Cloud checksums
81+
for file in *; do
82+
printf "# %s: %s bytes\n%s\n" \
83+
"${file}" \
84+
"$(stat -c %s ${file} -L)" \
85+
"$(sha256sum --tag ${file})" \
86+
| sudo tee -a "${file}.CHECKSUM"
87+
done
88+
cat ./*.CHECKSUM > CHECKSUM
89+
popd || { echo "${ARCH}: Failed to change directory"; break; }
90+
fi
91+
done
5692
# Live images should probably be fine. Check anyway what we want to do. Might be a simple move.
93+
for ARCH in "${ARCHES[@]}"; do
94+
echo "${ARCH}: Sorting live images"
95+
if [ -d "live/${ARCH}" ]; then
96+
pushd "live/${ARCH}" || { echo "${ARCH}: Failed to change directory"; break; }
97+
mv iso/* .
98+
rmdir iso
99+
test -f CHECKSUM && /bin/rm CHECKSUM
100+
# Generate "latest" links
101+
for x in * ; do ln -s "${x}" $(echo "${x}" | sed -E "s/${MAJOR}\.${MINOR}/${MAJOR}/g ; s/[0-9]+\.[0-9]+/latest/g") ; done
102+
# live checksums
103+
for file in *; do
104+
printf "# %s: %s bytes\n%s\n" \
105+
"${file}" \
106+
"$(stat -c %s ${file} -L)" \
107+
"$(sha256sum --tag ${file})" \
108+
| sudo tee -a "${file}.CHECKSUM"
109+
done
110+
cat ./*.CHECKSUM > CHECKSUM
111+
popd || { echo "${ARCH}: Failed to change directory"; break; }
112+
fi
113+
done
57114
fi
58115
# Delete the unnecessary dirs here.
59116
for EMPTYDIR in "${NONREPO_DIRS[@]}"; do

sync/lh-release-sync-to-staging.sh

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/bash
22
# Performs a full on sync of a minor release, directories and all. It calls the
33
# other scripts in this directory to assist where necessary.
4-
# Note that this is EL8 specific
54
#
65
# Source common variables
76
# shellcheck disable=SC2046,1091,1090
@@ -42,6 +41,17 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
4241
test -d "${x}/${ARCH}/iso" && rmdir "${x}/${ARCH}/iso"
4342
done
4443
pushd "isos/${ARCH}" || { echo "${ARCH}: Failed to change directory"; break; }
44+
45+
echo "Symlinking to 'latest' if ISO exists"
46+
test -f "Rocky-${REVISION}-${ARCH}-boot.iso" && ln -s "Rocky-${REVISION}-${ARCH}-boot.iso" "Rocky-${MAJ}-latest-${ARCH}-boot.iso"
47+
test -f "Rocky-${REVISION}-${ARCH}-dvd.iso" && ln -s "Rocky-${REVISION}-${ARCH}-dvd.iso" "Rocky-${MAJ}-latest-${ARCH}-dvd.iso"
48+
test -f "Rocky-${REVISION}-${ARCH}-dvd1.iso" && ln -s "Rocky-${REVISION}-${ARCH}-dvd1.iso" "Rocky-${MAJ}-latest-${ARCH}-dvd.iso"
49+
test -f "Rocky-${REVISION}-${ARCH}-minimal.iso" && ln -s "Rocky-${REVISION}-${ARCH}-minimal.iso" "Rocky-${MAJ}-latest-${ARCH}-minimal.iso"
50+
echo "(Re)generating manifests"
51+
for file in *.iso; do
52+
xorriso -dev "${file}" --find | tail -n+2 | tr -d "'" | cut -c2- | sort > "${file}.manifest"
53+
done
54+
4555
# ISO checksums
4656
for file in *.iso; do
4757
printf "# %s: %s bytes\n%s\n" \
@@ -51,6 +61,7 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
5161
| sudo tee -a "${file}.CHECKSUM"
5262
done
5363
cat ./*.CHECKSUM > CHECKSUM
64+
# GPG sign the checksums
5465
popd || { echo "Could not change directory"; break; }
5566
done
5667
# Sort the cloud images here. Probably just a directory move, make some checksums (unless they're already there)
@@ -108,22 +119,22 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
108119
popd || { echo "${COMPOSE}: Failed to change directory"; break; }
109120

110121
TARGET="${STAGING_ROOT}/${CATEGORY_STUB}/${REV}"
111-
UTILS="${STAGING_ROOT}/${CATEGORY_STUB}/utils/${MAJOR}"
122+
#UTILS="${STAGING_ROOT}/${CATEGORY_STUB}/utils/${MAJOR}"
112123
mkdir -p "${TARGET}"
113124
pushd "${SYNCSRC}" || { echo "${COMPOSE}: Failed to change directory"; break; }
114125
if [[ "${COMPOSE}" != "Rocky" ]]; then
115126
rsync_no_delete_staging_with_excludes "${TARGET}" "metadata"
116127
else
117-
if [ -d "${TARGET}/devel" ]; then
118-
echo "Moving devel directory temporarily..."
119-
mv "${TARGET}/devel" "${UTILS}/devel"
120-
fi
128+
#if [ -d "${TARGET}/devel" ]; then
129+
# echo "Moving devel directory temporarily..."
130+
# mv "${TARGET}/devel" "${UTILS}/devel"
131+
#fi
121132
echo "Begin syncing..."
122133
rsync_delete_staging "${TARGET}"
123-
if [ -d "${UTILS}/devel" ]; then
124-
echo "Moving devel back..."
125-
mv "${UTILS}/devel" "${TARGET}/devel"
126-
fi
134+
#if [ -d "${UTILS}/devel" ]; then
135+
# echo "Moving devel back..."
136+
# mv "${UTILS}/devel" "${TARGET}/devel"
137+
#fi
127138
fi
128139
popd || { echo "${COMPOSE}: Failed to change directory"; break; }
129140
done

sync/minor-release-sync-to-staging.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22
# Performs a full on sync of a minor release, directories and all. It calls the
33
# other scripts in this directory to assist where necessary.
4-
# Note that this is EL8, EL10+ only
54
#
65
# Source common variables
76
# shellcheck disable=SC2046,1091,1090
7+
export SHORT=Rocky
88
source $(dirname "$0")/common
99

1010
# Major Version (eg, 8)

0 commit comments

Comments
 (0)