Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update build workflow #7

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading