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

Add rpm and deb packaging for ppc64le and s390x #10824

Merged
merged 3 commits into from
Mar 15, 2021
Merged
Show file tree
Hide file tree
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
23 changes: 19 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export GO111MODULE := on

GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
GOARM ?= 7 # the default is 5
GOPATH ?= $(shell go env GOPATH)
BUILD_DIR ?= ./out
$(shell mkdir -p $(BUILD_DIR))
Expand Down Expand Up @@ -191,7 +192,7 @@ endif

out/minikube$(IS_EXE): $(SOURCE_GENERATED) $(SOURCE_FILES) go.mod
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
$(call DOCKER,$(BUILD_IMAGE),GOOS=$(GOOS) GOARCH=$(GOARCH) /usr/bin/make $@)
$(call DOCKER,$(BUILD_IMAGE),GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) /usr/bin/make $@)
else
$(if $(quiet),@echo " GO $@")
$(Q)go build $(MINIKUBE_GOFLAGS) -tags "$(MINIKUBE_BUILD_TAGS)" -ldflags="$(MINIKUBE_LDFLAGS)" -o $@ k8s.io/minikube/cmd/minikube
Expand All @@ -205,13 +206,25 @@ out/minikube-linux-x86_64: out/minikube-linux-amd64
$(if $(quiet),@echo " CP $@")
$(Q)cp $< $@

out/minikube-linux-armhf: out/minikube-linux-arm
$(if $(quiet),@echo " CP $@")
$(Q)cp $< $@

out/minikube-linux-armv7hl: out/minikube-linux-arm
$(if $(quiet),@echo " CP $@")
$(Q)cp $< $@

out/minikube-linux-aarch64: out/minikube-linux-arm64
$(if $(quiet),@echo " CP $@")
$(Q)cp $< $@

out/minikube-linux-ppc64el: out/minikube-linux-ppc64le
$(if $(quiet),@echo " CP $@")
$(Q)cp $< $@

.PHONY: minikube-linux-amd64 minikube-linux-arm64
minikube-linux-amd64: out/minikube-linux-amd64 ## Build Minikube for Linux 64bit
minikube-linux-arm64: out/minikube-linux-arm64 ## Build Minikube for arm 64bit
minikube-linux-amd64: out/minikube-linux-amd64 ## Build Minikube for Linux x86 64bit
minikube-linux-arm64: out/minikube-linux-arm64 ## Build Minikube for Linux ARM 64bit

.PHONY: minikube-darwin-amd64 minikube-darwin-arm64
minikube-darwin-amd64: out/minikube-darwin-amd64 ## Build Minikube for Darwin x86 64bit
Expand All @@ -220,12 +233,14 @@ minikube-darwin-arm64: out/minikube-darwin-arm64 ## Build Minikube for Darwin AR
.PHONY: minikube-windows-amd64.exe
minikube-windows-amd64.exe: out/minikube-windows-amd64.exe ## Build Minikube for Windows 64bit

eq = $(and $(findstring x$(1),x$(2)),$(findstring x$(2),x$(1)))

out/minikube-%: $(SOURCE_GENERATED) $(SOURCE_FILES)
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
$(call DOCKER,$(BUILD_IMAGE),/usr/bin/make $@)
else
$(if $(quiet),@echo " GO $@")
$(Q)GOOS="$(firstword $(subst -, ,$*))" GOARCH="$(lastword $(subst -, ,$(subst $(IS_EXE), ,$*)))" \
$(Q)GOOS="$(firstword $(subst -, ,$*))" GOARCH="$(lastword $(subst -, ,$(subst $(IS_EXE), ,$*)))" $(if $(call eq,$(lastword $(subst -, ,$(subst $(IS_EXE), ,$*))),arm),GOARM=$(GOARM))\
go build -tags "$(MINIKUBE_BUILD_TAGS)" -ldflags="$(MINIKUBE_LDFLAGS)" -a -o $@ k8s.io/minikube/cmd/minikube
endif

Expand Down
23 changes: 17 additions & 6 deletions hack/jenkins/release_build_and_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
set -eux -o pipefail
readonly VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}"
readonly DEB_VERSION="${VERSION/-/\~}"
readonly DEB_REVISION="0"
readonly RPM_VERSION="${DEB_VERSION}"
readonly RPM_REVISION="0"
readonly TAGNAME="v${VERSION}"

# Make sure the tag matches the Makefile
Expand All @@ -48,12 +50,18 @@ env BUILD_IN_DOCKER=y \
all \
out/minikube-darwin-arm64 \
out/minikube-installer.exe \
"out/minikube_${DEB_VERSION}-0_amd64.deb" \
"out/minikube_${DEB_VERSION}-0_arm64.deb" \
"out/minikube-${RPM_VERSION}-0.x86_64.rpm" \
"out/minikube-${RPM_VERSION}-0.aarch64.rpm" \
"out/docker-machine-driver-kvm2_${DEB_VERSION}-0_amd64.deb" \
"out/docker-machine-driver-kvm2-${RPM_VERSION}-0.x86_64.rpm"
"out/minikube_${DEB_VERSION}-${DEB_REVISION}_amd64.deb" \
"out/minikube_${DEB_VERSION}-${DEB_REVISION}_arm64.deb" \
"out/minikube_${DEB_VERSION}-${DEB_REVISION}_armhf.deb" \
"out/minikube_${DEB_VERSION}-${DEB_REVISION}_ppc64el.deb" \
"out/minikube_${DEB_VERSION}-${DEB_REVISION}_s390x.deb" \
"out/minikube-${RPM_VERSION}-${RPM_REVISION}.x86_64.rpm" \
"out/minikube-${RPM_VERSION}-${RPM_REVISION}.aarch64.rpm" \
"out/minikube-${RPM_VERSION}-${RPM_REVISION}.armv7hl.rpm" \
"out/minikube-${RPM_VERSION}-${RPM_REVISION}.ppc64le.rpm" \
"out/minikube-${RPM_VERSION}-${RPM_REVISION}.s390x.rpm" \
"out/docker-machine-driver-kvm2_${DEB_VERSION}-${DEB_REVISION}_amd64.deb" \
"out/docker-machine-driver-kvm2-${RPM_VERSION}-${RPM_REVISION}.x86_64.rpm"

# check if 'commit: <commit-id>' line contains '-dirty' commit suffix
BUILT_VERSION=$("out/minikube-$(go env GOOS)-$(go env GOARCH)" version)
Expand All @@ -68,6 +76,9 @@ fi
# Don't upload temporary copies, avoid unused duplicate files in the release storage
rm -f out/minikube-linux-x86_64
rm -f out/minikube-linux-aarch64
rm -f out/minikube-linux-armhf
rm -f out/minikube-linux-armv7hl
rm -f out/minikube-linux-ppc64el
rm -f out/minikube-windows-amd64

make checksum
Expand Down