Skip to content

Commit

Permalink
release-build: build cri-o for each Kubernetes version
Browse files Browse the repository at this point in the history
CRI-O is coupled to Kubernetes for the releases, while the major and the
minor follows Kubernetes streams, the patch version is independant, so
we need to fetch the latest patch release for each minor Kubernetes
version.

sysupdate configuration is generated similar to Kubernetes.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
  • Loading branch information
tormath1 committed Aug 2, 2024
1 parent 56de033 commit 58965dc
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions release_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ echo "================================================="
KBS_VERS=$(curl -fsSL --retry-delay 1 --retry 60 --retry-connrefused \
--retry-max-time 60 --connect-timeout 20 \
https://raw.githubusercontent.com/kubernetes/website/main/data/releases/schedule.yaml \
| yq -r '.schedules[] | .previousPatches[0] // (.release = .release + ".0") | .release' \
| awk '{print "kubernetes-v"$1}')
| yq -r '.schedules[] | .previousPatches[0] // (.release = .release + ".0") | .release')
if [[ -z "${KBS_VERS}" ]] ; then
echo "Failed fetching Kubernetes versions"
exit 1
Expand All @@ -25,6 +24,16 @@ fi
KBS_VERS_ARRAY=(${KBS_VERS})
printf "%s\n" "${KBS_VERS_ARRAY[@]}"

echo "Fetching list of latest CRI-O patch releases"
echo "================================================="
git clone https://github.com/cri-o/cri-o

CRIO=()
for r in "${KBS_VERS_ARRAY[@]}"; do
version=$(git -C cri-o tag -l --sort=-v:refname "v${r%.*}.*" | head -n1)
CRIO+=( "crio-${version:1}" )
done

echo
echo "Fetching previous 'latest' release sysexts"
echo "=========================================="
Expand All @@ -47,7 +56,13 @@ echo "================"

mapfile -t images < <( awk '{ content=sub("[[:space:]]*#.*", ""); if ($0) print $0; }' \
release_build_versions.txt )
images+=("${KBS_VERS_ARRAY[@]}")

KUBERNETES=()
for v in "${KBS_VERS_ARRAY[@]}"; do
KUBERNETES+=( "kubernetes-v${v}" )
done
images+=( "${CRIO[@]}" )
images+=( "${KUBERNETES[@]}" )

echo "# Release $(date '+%Y-%m-%d %R')" > Release.md
echo "The release adds the following sysexts:" >> Release.md
Expand All @@ -67,8 +82,8 @@ for image in "${images[@]}"; do
echo "* ${target}" >> Release.md
done
streams+=("${component}:-@v")
if [ "${component}" = "kubernetes" ]; then
streams+=("kubernetes-${version%.*}:.@v")
if [ "${component}" = "kubernetes" ] || [ "${component}" = "crio" ]; then
streams+=("${component}-${version%.*}:.@v")
# Should give, e.g., v1.28 for v1.28.2 (use ${version#*.*.} to get 2)
fi
done
Expand Down

0 comments on commit 58965dc

Please sign in to comment.