Skip to content

Commit

Permalink
ci: update build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
SandhyaRavi2403 committed Oct 24, 2024
1 parent 7c70e4a commit 594224d
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ ALLOW_OVERRIDE=${ALLOW_OVERRIDE:-}
SKIP_BUILD=${SKIP_BUILD:-}
SKIP_PUSH_LATEST=${SKIP_PUSH_LATEST:-}
LINUX_ARCH=${LINUX_ARCH:-amd64 arm arm64 ppc64le s390x}
WINDOWS_DISTROS=${WINDOWS_DISTROS:-1809 ltsc2022}
#WINDOWS_DISTROS=${WINDOWS_DISTROS:-1809 ltsc2022}
WINDOWS_DISTROS=${WINDOWS_DISTROS:-}

echo "REGISTRY: $REGISTRY"
echo "VERSION: $VERSION"
Expand Down Expand Up @@ -234,10 +235,12 @@ function docker_create_multi_arch() {
local linux_images=$(echo "${LINUX_ARCH}" | tr ' ' '\n' | while read -r arch; do \
echo $image:${VERSION}_linux_${arch}; \
done);
local windows_images=$(echo "${WINDOWS_DISTROS}" | tr ' ' '\n' | while read -r distro; do \
echo $image:${VERSION}_windows_${distro}; \
done);
local all_images="${linux_images} ${windows_images}"
# excluding the windows build
# local windows_images=$(echo "${WINDOWS_DISTROS}" | tr ' ' '\n' | while read -r distro; do \
# echo $image:${VERSION}_windows_${distro}; \
# done);
#local all_images="${linux_images} ${windows_images}"
local all_images="${linux_images}"
# create a manifest with all the images created
docker manifest create --amend $manifest_image $all_images
Expand All @@ -251,12 +254,12 @@ function docker_create_multi_arch() {
# annotate the windows images with the base image os-version
# from https://github.com/kubernetes-csi/csi-release-tools/blob/5b9a1e06794ddb137ff7e2d565416cc6934ec380/build.make#L181-L189
echo "${WINDOWS_DISTROS}" | tr ' ' '\n' | while read -r distro; do
local windows_image=$image:${VERSION}_windows_${distro}
# the image matches the value in the Makefile
local os_version=$(docker manifest inspect mcr.microsoft.com/windows/servercore:${distro} | grep "os.version" | head -n 1 | awk '{print $2}' | sed -e 's/"//g')
docker manifest annotate --os-version ${os_version} $manifest_image $windows_image
done
# echo "${WINDOWS_DISTROS}" | tr ' ' '\n' | while read -r distro; do
# local windows_image=$image:${VERSION}_windows_${distro}
# # the image matches the value in the Makefile
# local os_version=$(docker manifest inspect mcr.microsoft.com/windows/servercore:${distro} | grep "os.version" | head -n 1 | awk '{print $2}' | sed -e 's/"//g')
# docker manifest annotate --os-version ${os_version} $manifest_image $windows_image
# done
docker manifest push --purge $manifest_image
}
Expand Down

0 comments on commit 594224d

Please sign in to comment.