Skip to content

Commit ed4ec0a

Browse files
committed
initial modification of release syncs
1 parent cbbdd1c commit ed4ec0a

File tree

3 files changed

+48
-33
lines changed

3 files changed

+48
-33
lines changed

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

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,41 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
2424

2525
if [[ "${COMPOSE}" == "Rocky" ]]; then
2626
# ISO Work before syncing
27-
mkdir -p isos/{x86_64,aarch64}
27+
for ARCH in "${ARCHES[@]}"; do
28+
mkdir -p "isos/${ARCH}"
29+
done
2830

2931
# Sort the ISO's
3032
for ARCH in "${ARCHES[@]}"; do
31-
for x in BaseOS Minimal; do
32-
if [[ "${x}" != "BaseOS" ]]; then
33-
echo "${x} ${ARCH}: Removing unnecessary boot image"
34-
/bin/rm -v "${x}/${ARCH}/iso/Rocky-${REVISION}-20"*"${ARCH}"*.iso
33+
for x in "${ISO_TYPES[@]}"; do
34+
## Check if the ISO even exists, if not skip
35+
if ls "${x}/${ARCH}/iso/"*.iso 1> /dev/null 2>&1; then
36+
echo "${x} ${ARCH}: Moving ISO images"
37+
mv "${x}/${ARCH}/iso/"* "isos/${ARCH}/"
38+
else
39+
echo "${x} ${ARCH}: No ISOs were found"
3540
fi
36-
echo "${x} ${ARCH}: Moving ISO images"
37-
mv "${x}/${ARCH}/iso/"* "isos/${ARCH}/"
41+
echo "${x} ${ARCH}: Removing original ISO directory if applicable"
42+
test -d "${x}/${ARCH}/iso" && rmdir "${x}/${ARCH}/iso"
3843
done
3944
pushd "isos/${ARCH}" || { echo "${ARCH}: Failed to change directory"; break; }
40-
# ln -s "Rocky-${REVISION}-${ARCH}-boot.iso" "Rocky-${ARCH}-boot.iso"
41-
# ln -s "Rocky-${REVISION}-${ARCH}-dvd1.iso" "Rocky-${ARCH}-dvd1.iso"
42-
# ln -s "Rocky-${REVISION}-${ARCH}-dvd1.iso" "Rocky-${ARCH}-dvd.iso"
43-
# ln -s "Rocky-${REVISION}-${ARCH}-minimal.iso" "Rocky-${ARCH}-minimal.iso"
4445
for file in *.iso; do
4546
printf "# %s: %s bytes\n%s\n" \
4647
"${file}" \
4748
"$(stat -c %s ${file} -L)" \
4849
"$(sha256sum --tag ${file})" \
49-
| sudo tee -a CHECKSUM;
50+
| sudo tee -a "${file}.CHECKSUM"
5051
done
52+
cat ./*.CHECKSUM > CHECKSUM
5153
popd || { echo "Could not change directory"; break; }
5254
done
53-
mkdir -p live/x86_64
54-
ln -s live Live
55+
# Sort the cloud images here. Probably just a directory move, make some checksums (unless they're already there)
56+
# Live images should probably be fine. Check anyway what we want to do. Might be a simple move.
5557
fi
58+
# Delete the unnecessary dirs here.
59+
for EMPTYDIR in "${NONREPO_DIRS[@]}"; do
60+
rm -rf "${EMPTYDIR}"
61+
done
5662
popd || { echo "${COMPOSE}: Failed to change directory"; break; }
5763

5864
TARGET="${STAGING_ROOT}/${CATEGORY_STUB}/${REV}"
@@ -66,7 +72,6 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
6672
popd || { echo "${COMPOSE}: Failed to change directory"; break; }
6773
done
6874

69-
7075
# Create symlinks for repos that were once separate from the main compose
7176
for LINK in "${!LINK_REPOS[@]}"; do
7277
ln -sr "${STAGING_ROOT}/${CATEGORY_STUB}/${REV}/${LINK}" \

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

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
2626
if [[ "${COMPOSE}" == "Rocky" ]]; then
2727
# ISO Work before syncing
2828
for ARCH in "${ARCHES[@]}"; do
29-
mkdir -p isos/${ARCH}
29+
mkdir -p "isos/${ARCH}"
3030
done
3131

3232
# Sort the ISO's
@@ -36,8 +36,15 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
3636
echo "${x} ${ARCH}: Removing unnecessary boot image"
3737
/bin/rm -v "${x}/${ARCH}/iso/Rocky-${REVISION}-20"*"${ARCH}"*.iso
3838
fi
39-
echo "${x} ${ARCH}: Moving ISO images"
40-
mv "${x}/${ARCH}/iso/"* "isos/${ARCH}/"
39+
## Check if the ISO even exists, if not skip
40+
if ls "${x}/${ARCH}/iso/"*.iso 1> /dev/null 2>&1; then
41+
echo "${x} ${ARCH}: Moving ISO images"
42+
mv "${x}/${ARCH}/iso/"* "isos/${ARCH}/"
43+
else
44+
echo "${x} ${ARCH}: No ISOs were found"
45+
fi
46+
echo "${x} ${ARCH}: Removing original ISO directory if applicable"
47+
test -d "${x}/${ARCH}/iso" && rmdir "${x}/${ARCH}/iso"
4148
done
4249
pushd "isos/${ARCH}" || { echo "${ARCH}: Failed to change directory"; break; }
4350
for file in *.iso; do
@@ -50,13 +57,13 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
5057
cat ./*.CHECKSUM > CHECKSUM
5158
popd || { echo "Could not change directory"; break; }
5259
done
53-
# Sort the cloud images here. Probably just a directory move.
54-
# Live images should probably be fine. Check anyway what we want to do.
55-
# Delete the unnecessary dirs here.
56-
for EMPTYDIR in "${NONREPO_DIRS[@]}"; do
57-
rm -rf "${EMPTYDIR}"
58-
done
60+
# Sort the cloud images here. Probably just a directory move, make some checksums (unless they're already there)
61+
# Live images should probably be fine. Check anyway what we want to do. Might be a simple move.
5962
fi
63+
# Delete the unnecessary dirs here.
64+
for EMPTYDIR in "${NONREPO_DIRS[@]}"; do
65+
rm -rf "${EMPTYDIR}"
66+
done
6067
popd || { echo "${COMPOSE}: Failed to change directory"; break; }
6168

6269
TARGET="${STAGING_ROOT}/${CATEGORY_STUB}/${REV}"

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,20 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
3131
for ARCH in "${ARCHES[@]}"; do
3232
for x in "${ISO_TYPES[@]}"; do
3333
## Check if the ISO even exists, if not skip
34-
## this is done using "continue" in a for loop
35-
echo "${x} ${ARCH}: Moving ISO images"
36-
mv "${x}/${ARCH}/iso/"* "isos/${ARCH}/"
37-
echo "${x} ${ARCH}: Removing original ISO directory"
38-
rmdir "${x}/${ARCH}/iso"
34+
if ls "${x}/${ARCH}/iso/"*.iso 1> /dev/null 2>&1; then
35+
echo "${x} ${ARCH}: Moving ISO images"
36+
mv "${x}/${ARCH}/iso/"* "isos/${ARCH}/"
37+
else
38+
echo "${x} ${ARCH}: No ISOs were found"
39+
fi
40+
echo "${x} ${ARCH}: Removing original ISO directory if applicable"
41+
test -d "${x}/${ARCH}/iso" && rmdir "${x}/${ARCH}/iso"
3942
done
4043
pushd "isos/${ARCH}" || { echo "${ARCH}: Failed to change directory"; break; }
41-
## Should we also check for their existence before doing an ln?
42-
ln -s "Rocky-${REVISION}-${ARCH}-boot.iso" "Rocky-${MAJ}-latest-${ARCH}-boot.iso"
43-
ln -s "Rocky-${REVISION}-${ARCH}-dvd1.iso" "Rocky-${MAJ}-latest-${ARCH}-dvd.iso"
44-
ln -s "Rocky-${REVISION}-${ARCH}-minimal.iso" "Rocky-${MAJ}-latest-${ARCH}-minimal.iso"
44+
echo "Symlinking to 'latest' if ISO exists"
45+
test -f "Rocky-${REVISION}-${ARCH}-boot.iso" && ln -s "Rocky-${REVISION}-${ARCH}-boot.iso" "Rocky-${MAJ}-latest-${ARCH}-boot.iso"
46+
test -f "Rocky-${REVISION}-${ARCH}-dvd1.iso" && ln -s "Rocky-${REVISION}-${ARCH}-dvd1.iso" "Rocky-${MAJ}-latest-${ARCH}-dvd.iso"
47+
test -f "Rocky-${REVISION}-${ARCH}-minimal.iso" && ln -s "Rocky-${REVISION}-${ARCH}-minimal.iso" "Rocky-${MAJ}-latest-${ARCH}-minimal.iso"
4548
for file in *.iso; do
4649
printf "# %s: %s bytes\n%s\n" \
4750
"${file}" \

0 commit comments

Comments
 (0)