Skip to content

Commit cbbdd1c

Browse files
committed
sync: start to update scripts for 10 release method
1 parent 0fdafdb commit cbbdd1c

File tree

7 files changed

+60
-38
lines changed

7 files changed

+60
-38
lines changed

sync/common

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ SIG_VAULT_STUB="mirror/vault/sig"
3636
#RELEASE_DIR="${CATEGORY_STUB}/${REVISION}${APPEND_TO_DIR}"
3737

3838
# Define arches we support
39-
# Override: Not Allowed
40-
ARCHES=(x86_64 aarch64)
39+
# Override: Set in relevant common file
40+
#ARCHES=()
4141

4242
# Source Major common
4343
# Override: Not Allowed
@@ -69,6 +69,10 @@ REV="${REVISION}${APPEND_TO_DIR}"
6969
# Override: Allowed
7070
VARIANTS=(boot minimal dvd1 dvd)
7171

72+
# Used to identify directories that should be removed
73+
# Override: Allowed
74+
NONREPO_DIRS=(Minimal Cloud)
75+
7276
# Syncing functions
7377
function parallel_rsync_no_delete_staging() {
7478
local TARGET="${1}"
@@ -116,6 +120,7 @@ function rsync_no_delete_staging_pungi() {
116120
--exclude COMMUNITY-CHARTER \
117121
--exclude extra_files.json \
118122
--exclude Minimal \
123+
--exclude Cloud \
119124
compose/ "${TARGET}"
120125
}
121126

@@ -125,6 +130,7 @@ function rsync_no_delete_staging_with_excludes() {
125130
sudo -l && rsync -vrlptDSHog --chown=10004:10005 --progress --human-readable \
126131
--exclude "${EXCLUDE}" \
127132
--exclude Minimal \
133+
--exclude Cloud \
128134
compose/ "${TARGET}"
129135
}
130136

@@ -134,6 +140,7 @@ function rsync_delete_staging_with_excludes() {
134140
sudo -l && rsync -vrlptDSHog --chown=10004:10005 --progress --human-readable \
135141
--exclude "${EXCLUDE}" \
136142
--exclude Minimal \
143+
--exclude Cloud \
137144
--delete \
138145
compose/ "${TARGET}"
139146
}
@@ -204,6 +211,7 @@ function rsync_no_delete_staging_pungi_dry() {
204211
--exclude COMMUNITY-CHARTER \
205212
--exclude extra_files.json \
206213
--exclude Minimal \
214+
--exclude Cloud \
207215
--dry-run \
208216
compose/ "${TARGET}"
209217
}
@@ -214,6 +222,7 @@ function rsync_no_delete_staging_with_excludes_dry() {
214222
sudo -l && rsync -vrlptDSHog --chown=10004:10005 --progress --human-readable \
215223
--exclude "${EXCLUDE}" \
216224
--exclude Minimal \
225+
--exclude Cloud \
217226
--dry-run \
218227
compose/ "${TARGET}"
219228
}
@@ -224,6 +233,7 @@ function rsync_delete_staging_with_excludes_dry() {
224233
sudo -l && rsync -vrlptDSHog --chown=10004:10005 --progress --human-readable \
225234
--exclude "${EXCLUDE}" \
226235
--exclude Minimal \
236+
--exclude Cloud \
227237
--dry-run \
228238
compose/ "${TARGET}"
229239
}

sync/common_10

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ esac
2525

2626
MAJOR="${REVISION%.*}"
2727
MINOR="${REVISION#*.}"
28-
ARCHES=(x86_64 aarch64 ppc64le s390x)
28+
ARCHES=(x86_64 aarch64 ppc64le s390x riscv64)
29+
ISO_TYPES=(BaseOS Minimal)
30+
IMAGE_TYPES=(Cloud Live)
2931
STAGING_ROOT="/mnt/repos-staging"
3032
PRODUCTION_ROOT="/mnt/repos-production"
3133

sync/common_8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ esac
2626

2727
MAJOR="${REVISION%.*}"
2828
MINOR="${REVISION#*.}"
29+
ARCHES=(x86_64 aarch64)
30+
ISO_TYPES=(BaseOS Minimal)
2931
STAGING_ROOT="/mnt/repos-staging"
3032
PRODUCTION_ROOT="/mnt/repos-production"
3133

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

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

15-
if [[ "${RLVER}" -eq "9" ]]; then
15+
if [[ "${MAJ}" -eq "9" ]]; then
1616
echo "Invalid release"
1717
exit 1
1818
fi
@@ -25,11 +25,13 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
2525

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

3032
# Sort the ISO's
3133
for ARCH in "${ARCHES[@]}"; do
32-
for x in BaseOS Minimal; do
34+
for x in "${ISO_TYPES[@]}"; do
3335
if [[ "${x}" != "BaseOS" ]]; then
3436
echo "${x} ${ARCH}: Removing unnecessary boot image"
3537
/bin/rm -v "${x}/${ARCH}/iso/Rocky-${REVISION}-20"*"${ARCH}"*.iso
@@ -38,21 +40,22 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
3840
mv "${x}/${ARCH}/iso/"* "isos/${ARCH}/"
3941
done
4042
pushd "isos/${ARCH}" || { echo "${ARCH}: Failed to change directory"; break; }
41-
# ln -s "Rocky-${REVISION}-${ARCH}-boot.iso" "Rocky-${ARCH}-boot.iso"
42-
# ln -s "Rocky-${REVISION}-${ARCH}-dvd1.iso" "Rocky-${ARCH}-dvd1.iso"
43-
# ln -s "Rocky-${REVISION}-${ARCH}-dvd1.iso" "Rocky-${ARCH}-dvd.iso"
44-
# ln -s "Rocky-${REVISION}-${ARCH}-minimal.iso" "Rocky-${ARCH}-minimal.iso"
4543
for file in *.iso; do
4644
printf "# %s: %s bytes\n%s\n" \
4745
"${file}" \
4846
"$(stat -c %s ${file} -L)" \
4947
"$(sha256sum --tag ${file})" \
50-
| sudo tee -a CHECKSUM;
48+
| sudo tee -a "${file}.CHECKSUM"
5149
done
50+
cat ./*.CHECKSUM > CHECKSUM
5251
popd || { echo "Could not change directory"; break; }
5352
done
54-
mkdir -p live/x86_64
55-
ln -s live Live
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
5659
fi
5760
popd || { echo "${COMPOSE}: Failed to change directory"; break; }
5861

@@ -67,7 +70,6 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
6770
popd || { echo "${COMPOSE}: Failed to change directory"; break; }
6871
done
6972

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

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

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ source $(dirname "$0")/common
1010
# Major Version (eg, 8)
1111
MAJ=${RLVER}
1212

13-
if [ "${MAJ}" == "9" ]; then
13+
if [ "${MAJ}" -eq "9" ]; then
1414
echo "Does not work for Rocky Linux 9. Please use sync-to-staging"
1515
exit 32
1616
fi
@@ -23,21 +23,22 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
2323

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

2830
# Sort the ISO's
2931
for ARCH in "${ARCHES[@]}"; do
30-
for x in BaseOS Minimal; do
32+
for x in "${ISO_TYPES[@]}"; do
33+
## Check if the ISO even exists, if not skip
34+
## this is done using "continue" in a for loop
3135
echo "${x} ${ARCH}: Moving ISO images"
3236
mv "${x}/${ARCH}/iso/"* "isos/${ARCH}/"
37+
echo "${x} ${ARCH}: Removing original ISO directory"
38+
rmdir "${x}/${ARCH}/iso"
3339
done
3440
pushd "isos/${ARCH}" || { echo "${ARCH}: Failed to change directory"; break; }
35-
# old deprecated way
36-
ln -s "Rocky-${REVISION}-${ARCH}-boot.iso" "Rocky-${ARCH}-boot.iso"
37-
ln -s "Rocky-${REVISION}-${ARCH}-dvd1.iso" "Rocky-${ARCH}-dvd1.iso"
38-
ln -s "Rocky-${REVISION}-${ARCH}-dvd1.iso" "Rocky-${ARCH}-dvd.iso"
39-
ln -s "Rocky-${REVISION}-${ARCH}-minimal.iso" "Rocky-${ARCH}-minimal.iso"
40-
# new way
41+
## Should we also check for their existence before doing an ln?
4142
ln -s "Rocky-${REVISION}-${ARCH}-boot.iso" "Rocky-${MAJ}-latest-${ARCH}-boot.iso"
4243
ln -s "Rocky-${REVISION}-${ARCH}-dvd1.iso" "Rocky-${MAJ}-latest-${ARCH}-dvd.iso"
4344
ln -s "Rocky-${REVISION}-${ARCH}-minimal.iso" "Rocky-${MAJ}-latest-${ARCH}-minimal.iso"
@@ -48,13 +49,16 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
4849
"$(sha256sum --tag ${file})" \
4950
| sudo tee -a "${file}.CHECKSUM"
5051
done
51-
cat *.CHECKSUM > CHECKSUM
52+
cat ./*.CHECKSUM > CHECKSUM
5253
popd || { echo "Could not change directory"; break; }
5354
done
54-
rm -rf Minimal
55-
mkdir -p live/x86_64
56-
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.
5757
fi
58+
# Delete the unnecessary dirs here.
59+
for EMPTYDIR in "${NONREPO_DIRS[@]}"; do
60+
rm -rf "${EMPTYDIR}"
61+
done
5862
popd || { echo "${COMPOSE}: Failed to change directory"; break; }
5963

6064
TARGET="${STAGING_ROOT}/${CATEGORY_STUB}/${REV}"
@@ -68,7 +72,6 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
6872
popd || { echo "${COMPOSE}: Failed to change directory"; break; }
6973
done
7074

71-
7275
# Create symlinks for repos that were once separate from the main compose
7376
for LINK in "${!LINK_REPOS[@]}"; do
7477
ln -sr "${STAGING_ROOT}/${CATEGORY_STUB}/${REV}/${LINK}" \
@@ -95,12 +98,15 @@ done
9598

9699
# sign all repos
97100
echo "Signing all repositories"
98-
test -f $(dirname "$0")/sign-repos-only.sh
99-
ret_val=$?
100-
101-
if [ "$ret_val" -eq 0 ]; then
102-
$(dirname "$0")/sign-repos-only.sh
103-
fi
101+
for ARCH in "${ARCHES[@]}"; do
102+
for REPO in "${MODS_REPOS[@]}"; do
103+
OS_TARGET="${STAGING_ROOT}/${CATEGORY_STUB}/${REV}/${REPO}/${ARCH}/os/repodata/repomd.xml"
104+
GOLD_TARGET="${STAGING_ROOT}/${CATEGORY_STUB}/${REV}/${REPO}/${ARCH}/kickstart/repodata/repomd.xml"
105+
echo "Signing ${REPO} ${ARCH}"
106+
sign_data "${OS_TARGET}" "${MAJ}"
107+
sign_data "${GOLD_TARGET}" "${MAJ}"
108+
done
109+
done
104110

105111
# Change Symlink if required
106112
echo "Setting symlink to ${REV}"

sync/sign-repos-only.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ for x in "${ARCHES[@]}"; do
6464
fi
6565
done
6666

67-
echo "** Sign module repos"
67+
echo "** Sign module repos if applicable"
6868
for y in "${MODS[@]}"; do
6969
test -d "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os"
7070
ret_val=$?

sync/sync-to-staging.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ if [[ $# -eq 0 ]]; then
1212
exit 1
1313
fi
1414

15-
if [[ "${RLVER}" -ne "8" ]]; then
16-
echo "This is only used for Rocky Linux 8 releases."
15+
if [[ "${RLVER}" -eq "8" ]]; then
16+
echo "This is only used for Rocky Linux 8 and 10 releases."
1717
fi
1818

1919
# Major Version (eg, 8)
@@ -101,7 +101,7 @@ if [ $ret_val -eq "0" ]; then
101101
done
102102
done
103103

104-
echo "** Updating modules"
104+
echo "** Updating modules if applicable"
105105
for arch in "${ARCHES[@]}"; do
106106
for mod_repo in "${MODS[@]}"; do
107107
echo "Trying ${arch} ${mod_repo}..."

0 commit comments

Comments
 (0)