Skip to content

Commit 31b76d3

Browse files
author
Louis Abel
committed
update lh script for images/live
1 parent 6ad574e commit 31b76d3

2 files changed

Lines changed: 43 additions & 5 deletions

File tree

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

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

15-
if [[ "${MAJ}" -eq "9" ]]; then
16-
echo "Invalid release"
17-
exit 1
18-
fi
19-
2015
# sync all pieces of a release, including extras, nfv, etc
2116
for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
2217
echo "${COMPOSE}: Syncing"
@@ -47,6 +42,7 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
4742
test -d "${x}/${ARCH}/iso" && rmdir "${x}/${ARCH}/iso"
4843
done
4944
pushd "isos/${ARCH}" || { echo "${ARCH}: Failed to change directory"; break; }
45+
# ISO checksums
5046
for file in *.iso; do
5147
printf "# %s: %s bytes\n%s\n" \
5248
"${file}" \
@@ -58,7 +54,48 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
5854
popd || { echo "Could not change directory"; break; }
5955
done
6056
# Sort the cloud images here. Probably just a directory move, make some checksums (unless they're already there)
57+
for ARCH in "${ARCHES[@]}"; do
58+
echo "${ARCH}: Sorting cloud images"
59+
if [ -d "images/${ARCH}" ]; then
60+
pushd "images/${ARCH}" || { echo "${ARCH}: Failed to change directory"; break; }
61+
mv images/* .
62+
rmdir images
63+
test -f CHECKSUM && /bin/rm CHECKSUM
64+
# Drop vagrant from name if they are there
65+
echo "${ARCH}: Looking for vagrant names and dropping them"
66+
for x in * ; do if [[ "${x}" =~ "vagrant" ]]; then mv "${x}" $(echo ${x} | sed 's/\.vagrant\..*\(\.box\)/\1/g') ; fi ; done
67+
# Cloud checksums
68+
for file in *; do
69+
printf "# %s: %s bytes\n%s\n" \
70+
"${file}" \
71+
"$(stat -c %s ${file} -L)" \
72+
"$(sha256sum --tag ${file})" \
73+
| sudo tee -a "${file}.CHECKSUM"
74+
done
75+
cat ./*.CHECKSUM > CHECKSUM
76+
popd || { echo "${ARCH}: Failed to change directory"; break; }
77+
fi
78+
done
6179
# Live images should probably be fine. Check anyway what we want to do. Might be a simple move.
80+
for ARCH in "${ARCHES[@]}"; do
81+
echo "${ARCH}: Sorting live images"
82+
if [ -d "live/${ARCH}" ]; then
83+
pushd "live/${ARCH}" || { echo "${ARCH}: Failed to change directory"; break; }
84+
mv iso/* .
85+
rmdir iso
86+
test -f CHECKSUM && /bin/rm CHECKSUM
87+
# live checksums
88+
for file in *; do
89+
printf "# %s: %s bytes\n%s\n" \
90+
"${file}" \
91+
"$(stat -c %s ${file} -L)" \
92+
"$(sha256sum --tag ${file})" \
93+
| sudo tee -a "${file}.CHECKSUM"
94+
done
95+
cat ./*.CHECKSUM > CHECKSUM
96+
popd || { echo "${ARCH}: Failed to change directory"; break; }
97+
fi
98+
done
6299
fi
63100
# Delete the unnecessary dirs here.
64101
for EMPTYDIR in "${NONREPO_DIRS[@]}"; do

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
4747
xorriso -dev "${file}" --find | tail -n+2 | tr -d "'" | cut -c2- | sort > "${file}.manifest"
4848
done
4949

50+
# ISO checksums
5051
for file in *.iso; do
5152
printf "# %s: %s bytes\n%s\n" \
5253
"${file}" \

0 commit comments

Comments
 (0)