Skip to content

Commit

Permalink
chore: support windows hpc image build
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
andyzhangx committed Jan 1, 2025
1 parent b2d2d00 commit 0edb091
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions release-tools/build.make
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ $(CMDS:%=push-multiarch-%): push-multiarch-%: check-pull-base-ref build-%
trap "docker buildx rm multiarchimage-buildertest" EXIT; \
dockerfile_linux=$$(if [ -e ./$(CMDS_DIR)/$*/Dockerfile ]; then echo ./$(CMDS_DIR)/$*/Dockerfile; else echo Dockerfile; fi); \
dockerfile_windows=$$(if [ -e ./$(CMDS_DIR)/$*/Dockerfile.Windows ]; then echo ./$(CMDS_DIR)/$*/Dockerfile.Windows; else echo Dockerfile.Windows; fi); \
dockerfile_windows_hp=$$(if [ -e ./$(CMDS_DIR)/$*/Dockerfile.WindowsHostProcess ]; then echo ./$(CMDS_DIR)/$*/Dockerfile.WindowsHostProcess; else echo Dockerfile.WindowsHostProcess; fi); \
if [ '$(BUILD_PLATFORMS)' ]; then build_platforms='$(BUILD_PLATFORMS)'; else build_platforms="linux amd64"; fi; \
if ! [ -f "$$dockerfile_windows" ]; then \
build_platforms="$$(echo "$$build_platforms" | sed -e 's/windows *[^ ]* *[^ ]* *.exe *[^ ]* *[^ ]*//g' -e 's/; *;/;/g' -e 's/;[ ]*$$//')"; \
Expand All @@ -174,6 +175,17 @@ $(CMDS:%=push-multiarch-%): push-multiarch-%: check-pull-base-ref build-%
--label revision=$(REV) \
.; \
done; \
if [ -f "$$dockerfile_windows_hp" ]; then \
docker buildx build --push \
--tag $(IMAGE_NAME):$$escaped_buildx_platform-$$os-$$escaped_base_image$$tag-windows-hp \
--platform=windows/amd64 \
--file $$dockerfile_windows_hp \
--build-arg binary=./bin/$*.exe \
--label revision=$(REV) \
.; \
docker manifest create --amend $(IMAGE_NAME):$$tag-windows-hp; \
docker manifest push -p $(IMAGE_NAME):$$tag-windows-hp; \
fi; \
images=$$(echo "$$build_platforms" | tr ';' '\n' | while read -r os arch buildx_platform suffix base_image addon_image; do \
escaped_base_image=$${base_image/:/-}; \
escaped_buildx_platform=$${buildx_platform//\//-}; \
Expand Down

0 comments on commit 0edb091

Please sign in to comment.