Skip to content

Commit

Permalink
Add build-all-images make target
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernest Wong committed May 17, 2023
1 parent 3196ba5 commit ac56567
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions Makefile
Expand Up @@ -77,16 +77,31 @@ $(MAKE) $(OUTPUT)/bin/aws-iam-authenticator_$(VERSION)_$(1)_$(2)$(3) GOOS=$(1) G

endef

# Function build-image
# Parameters:
# 1: Target architecture
define build-image
$(MAKE) .image-linux-$(1)

endef

.PHONY: build-all-bins
build-all-bins:
$(foreach arch,$(BIN_ARCH_LINUX),$(call build-bin,linux,$(arch),))
$(foreach arch,$(BIN_ARCH_WINDOWS),$(call build-bin,windows,$(arch),.exe))
$(foreach arch,$(BIN_ARCH_DARWIN),$(call build-bin,darwin,$(arch),))

.PHONY: build-all-images
build-all-images:
$(foreach arch,$(BIN_ARCH_LINUX),$(call build-image,$(arch)))

.PHONY: image
image:
docker buildx build --output=type=docker --platform linux/amd64 \
--tag aws-iam-authenticator:$(VERSION)_$(GIT_COMMIT)_$(BUILD_DATE_STRIPPED) .
image: .image-linux-$(GOARCH)

.PHONY: .image-linux-%
.image-linux-%:
docker buildx build --output=type=docker --platform linux/$* \
--tag aws-iam-authenticator:$(VERSION)_$(GIT_COMMIT)_$(BUILD_DATE_STRIPPED)-linux_$* .

.PHONY: goreleaser
goreleaser:
Expand Down

0 comments on commit ac56567

Please sign in to comment.