2016-05-05 13:38:23 +00:00
# Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
2019-02-16 17:15:02 +00:00
# Bump these on release - and please check ISO_VERSION for correctness.
2019-03-27 04:53:29 +00:00
VERSION_MAJOR ?= 1
2021-10-28 17:58:52 +00:00
VERSION_MINOR ?= 24
2021-11-04 22:23:52 +00:00
VERSION_BUILD ?= 0
2020-05-13 02:50:21 +00:00
RAW_VERSION = $( VERSION_MAJOR) .$( VERSION_MINOR) .$( VERSION_BUILD)
2019-09-05 21:35:35 +00:00
VERSION ?= v$( RAW_VERSION)
2020-02-20 19:55:47 +00:00
KUBERNETES_VERSION ?= $( shell egrep "DefaultKubernetesVersion =" pkg/minikube/constants/constants.go | cut -d \" -f2)
2020-02-20 23:53:06 +00:00
KIC_VERSION ?= $( shell egrep "Version =" pkg/drivers/kic/types.go | cut -d \" -f2)
2020-02-06 21:12:43 +00:00
2019-02-16 17:15:02 +00:00
# Default to .0 for higher cache hit rates, as build increments typically don't require new ISO versions
2021-12-14 19:10:21 +00:00
ISO_VERSION ?= v1.24.0-1639505700-12892
2019-09-05 21:35:35 +00:00
# Dashes are valid in semver, but not Linux packaging. Use ~ to delimit alpha/beta
DEB_VERSION ?= $( subst -,~,$( RAW_VERSION) )
2021-01-27 22:45:53 +00:00
DEB_REVISION ?= 0
2020-12-18 16:01:17 +00:00
2019-09-05 21:35:35 +00:00
RPM_VERSION ?= $( DEB_VERSION)
2020-12-18 16:01:17 +00:00
RPM_REVISION ?= 0
2019-02-16 17:15:02 +00:00
2019-08-16 17:21:08 +00:00
# used by hack/jenkins/release_build_and_upload.sh and KVM_BUILD_IMAGE, see also BUILD_IMAGE below
2021-08-13 01:16:47 +00:00
# update this only by running `make update-golang-version`
2021-12-13 23:22:50 +00:00
GO_VERSION ?= 1.17.5
2021-08-30 21:53:28 +00:00
# update this only by running `make update-golang-version`
2021-12-13 23:22:50 +00:00
GO_K8S_VERSION_PREFIX ?= v1.24.0
2021-03-02 22:33:39 +00:00
# replace "x.y.0" => "x.y". kube-cross and golang.org/dl use different formats for x.y.0 go versions
KVM_GO_VERSION ?= $( GO_VERSION:.0= )
2019-08-15 20:46:25 +00:00
2016-09-07 23:44:01 +00:00
INSTALL_SIZE ?= $( shell du out/minikube-windows-amd64.exe | cut -f1)
2021-08-14 18:29:15 +00:00
BUILDROOT_BRANCH ?= 2021.02.4
2021-09-15 18:26:53 +00:00
# the go version on the line below is for the ISO and does not need to be updated often
2021-09-14 23:37:46 +00:00
GOLANG_OPTIONS = GO_VERSION = 1.17 GO_HASH_FILE = $( PWD) /deploy/iso/minikube-iso/go.hash
2021-09-14 20:37:46 +00:00
BUILDROOT_OPTIONS = BR2_EXTERNAL = ../../deploy/iso/minikube-iso $( GOLANG_OPTIONS)
2021-06-15 22:16:04 +00:00
REGISTRY ?= gcr.io/k8s-minikube
2017-06-28 20:47:54 +00:00
2019-06-25 17:12:55 +00:00
# Get git commit id
COMMIT_NO := $( shell git rev-parse HEAD 2> /dev/null || true )
COMMIT ?= $( if $( shell git status --porcelain --untracked-files= no) ," ${ COMMIT_NO } -dirty " ," ${ COMMIT_NO } " )
2020-09-10 22:55:08 +00:00
COMMIT_SHORT = $( shell git rev-parse --short HEAD 2> /dev/null || true )
2021-10-07 19:22:42 +00:00
# source code for image: https://github.com/spowelljr/xcgo
2021-10-06 22:26:39 +00:00
HYPERKIT_BUILD_IMAGE ?= gcr.io/k8s-minikube/xcgo:go1.17
2021-01-27 06:34:13 +00:00
2021-03-02 21:09:20 +00:00
# NOTE: "latest" as of 2021-02-06. kube-cross images aren't updated as often as Kubernetes
# https://github.com/kubernetes/kubernetes/blob/master/build/build-image/cross/VERSION
#
2021-08-30 21:36:59 +00:00
2021-12-13 20:30:07 +00:00
BUILD_IMAGE ?= us.gcr.io/k8s-artifacts-prod/build-image/kube-cross:$( GO_K8S_VERSION_PREFIX) -go$( GO_VERSION) -bullseye.0
2021-01-26 22:16:34 +00:00
2017-03-22 18:00:17 +00:00
ISO_BUILD_IMAGE ?= $( REGISTRY) /buildroot-image
2021-06-25 06:01:03 +00:00
KVM_BUILD_IMAGE_AMD64 ?= $( REGISTRY) /kvm-build-image_amd64:$( KVM_GO_VERSION)
KVM_BUILD_IMAGE_ARM64 ?= $( REGISTRY) /kvm-build-image_arm64:$( KVM_GO_VERSION)
2019-02-16 13:45:30 +00:00
2020-10-12 23:58:50 +00:00
ISO_BUCKET ?= minikube/iso
2017-02-03 19:59:40 +00:00
2018-06-24 06:07:13 +00:00
MINIKUBE_VERSION ?= $( ISO_VERSION)
MINIKUBE_BUCKET ?= minikube/releases
MINIKUBE_UPLOAD_LOCATION := gs://${ MINIKUBE_BUCKET }
2019-07-13 19:37:24 +00:00
MINIKUBE_RELEASES_URL = https://github.com/kubernetes/minikube/releases/download
2018-06-24 06:07:13 +00:00
2021-08-14 18:29:15 +00:00
KERNEL_VERSION ?= 4.19.202
2021-08-13 01:16:47 +00:00
# latest from https://github.com/golangci/golangci-lint/releases
# update this only by running `make update-golint-version`
2021-11-08 10:01:50 +00:00
GOLINT_VERSION ?= v1.43.0
2019-07-23 12:56:24 +00:00
# Limit number of default jobs, to avoid the CI builds running out of memory
2019-07-24 17:34:53 +00:00
GOLINT_JOBS ?= 4
2019-07-23 13:20:04 +00:00
# see https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint
2019-10-08 22:21:09 +00:00
GOLINT_GOGC ?= 100
2019-07-24 17:34:53 +00:00
# options for lint (golangci-lint)
2020-02-14 20:26:19 +00:00
GOLINT_OPTIONS = --timeout 7m \
2019-07-24 17:34:53 +00:00
--build-tags " ${ MINIKUBE_INTEGRATION_BUILD_TAGS } " \
2021-08-13 01:11:16 +00:00
--enable gofmt,goimports,gocritic,revive,gocyclo,misspell,nakedret,stylecheck,unconvert,unparam,dogsled \
2021-06-17 17:57:00 +00:00
--exclude 'variable on range scope.*in function literal|ifElseChain'
2019-07-24 17:34:53 +00:00
2019-05-09 18:46:14 +00:00
export GO111MODULE := on
2019-02-16 13:45:30 +00:00
2016-05-04 21:29:13 +00:00
GOOS ?= $( shell go env GOOS)
GOARCH ?= $( shell go env GOARCH)
2021-03-15 07:52:38 +00:00
GOARM ?= 7 # the default is 5
2018-07-04 11:23:00 +00:00
GOPATH ?= $( shell go env GOPATH)
2016-05-04 21:29:13 +00:00
BUILD_DIR ?= ./out
2017-10-19 15:00:56 +00:00
$( shell mkdir -p $ ( BUILD_DIR ) )
2019-10-21 20:11:30 +00:00
CURRENT_GIT_BRANCH ?= $( shell git branch | grep \* | cut -d ' ' -f2)
2017-10-19 15:00:56 +00:00
2016-05-27 04:58:12 +00:00
# Use system python if it exists, otherwise use Docker.
2016-06-23 17:50:09 +00:00
PYTHON := $( shell command -v python || echo " docker run --rm -it -v $( shell pwd ) :/minikube -w /minikube python python " )
2016-05-30 17:50:06 +00:00
BUILD_OS := $( shell uname -s)
2016-05-28 19:41:45 +00:00
2019-07-13 19:33:56 +00:00
SHA512SUM = $( shell command -v sha512sum || echo "shasum -a 512" )
2020-02-06 14:43:12 +00:00
# gvisor tag to automatically push changes to
# to update minikubes default, update deploy/addons/gvisor
GVISOR_TAG ?= latest
2021-03-23 07:03:42 +00:00
# auto-pause-hook tag to push changes to
2021-05-04 23:18:33 +00:00
AUTOPAUSE_HOOK_TAG ?= v0.0.2
2021-03-23 07:03:42 +00:00
2021-05-02 08:59:28 +00:00
# prow-test tag to push changes to
2021-05-03 17:40:25 +00:00
PROW_TEST_TAG ?= v0.0.1
2021-05-02 08:59:28 +00:00
2020-02-06 14:43:12 +00:00
# storage provisioner tag to push changes to
2021-03-29 19:52:35 +00:00
# NOTE: you will need to bump the PreloadVersion if you change this
STORAGE_PROVISIONER_TAG ?= v5
2020-02-06 14:43:12 +00:00
2020-09-27 17:00:35 +00:00
STORAGE_PROVISIONER_MANIFEST ?= $( REGISTRY) /storage-provisioner:$( STORAGE_PROVISIONER_TAG)
2020-01-09 19:25:01 +00:00
STORAGE_PROVISIONER_IMAGE ?= $( REGISTRY) /storage-provisioner-$( GOARCH) :$( STORAGE_PROVISIONER_TAG)
2016-11-29 19:55:49 +00:00
2018-06-19 21:07:37 +00:00
# Set the version information for the Kubernetes servers
2021-02-09 18:51:16 +00:00
MINIKUBE_LDFLAGS := -X k8s.io/minikube/pkg/version.version= $( VERSION) -X k8s.io/minikube/pkg/version.isoVersion= $( ISO_VERSION) -X k8s.io/minikube/pkg/version.gitCommitID= $( COMMIT) -X k8s.io/minikube/pkg/version.storageProvisionerVersion= $( STORAGE_PROVISIONER_TAG)
2020-02-05 19:32:32 +00:00
PROVISIONER_LDFLAGS := " -X k8s.io/minikube/pkg/storage.version= $( STORAGE_PROVISIONER_TAG) -s -w -extldflags '-static' "
2016-05-15 16:17:42 +00:00
2018-01-20 13:03:41 +00:00
MINIKUBEFILES := ./cmd/minikube/
HYPERKIT_FILES := ./cmd/drivers/hyperkit
STORAGE_PROVISIONER_FILES := ./cmd/storage-provisioner
KVM_DRIVER_FILES := ./cmd/drivers/kvm/
2018-10-06 17:00:45 +00:00
MINIKUBE_TEST_FILES := ./cmd/... ./pkg/...
2017-07-13 16:01:43 +00:00
2019-03-10 11:09:21 +00:00
# npm install -g markdownlint-cli
MARKDOWNLINT ?= markdownlint
2019-07-24 17:34:53 +00:00
2020-04-09 13:01:42 +00:00
MINIKUBE_MARKDOWN_FILES := README.md CONTRIBUTING.md CHANGELOG.md
2019-03-10 11:09:21 +00:00
2021-02-08 10:57:43 +00:00
MINIKUBE_BUILD_TAGS :=
2017-09-06 23:22:49 +00:00
MINIKUBE_INTEGRATION_BUILD_TAGS := integration $( MINIKUBE_BUILD_TAGS)
2019-05-20 20:30:40 +00:00
2021-06-17 17:57:00 +00:00
CMD_SOURCE_DIRS = cmd pkg deploy/addons translations
2019-06-22 12:34:18 +00:00
SOURCE_DIRS = $( CMD_SOURCE_DIRS) test
2021-06-17 17:57:00 +00:00
SOURCE_PACKAGES = ./cmd/... ./pkg/... ./deploy/addons/... ./translations/... ./test/...
2017-09-06 23:22:49 +00:00
2019-10-27 07:45:10 +00:00
SOURCE_FILES = $( shell find $( CMD_SOURCE_DIRS) -type f -name "*.go" | grep -v _test.go)
2021-04-13 15:24:28 +00:00
GOTEST_FILES = $( shell find $( CMD_SOURCE_DIRS) -type f -name "*.go" | grep _test.go)
2021-06-15 22:45:11 +00:00
ADDON_FILES = $( shell find "deploy/addons" -type f | grep -v "\.go" )
2021-06-17 17:57:00 +00:00
TRANSLATION_FILES = $( shell find "translations" -type f | grep -v "\.go" )
ASSET_FILES = $( ADDON_FILES) $( TRANSLATION_FILES)
2019-10-27 07:45:10 +00:00
2019-06-28 20:45:54 +00:00
# kvm2 ldflags
2019-08-19 00:44:40 +00:00
KVM2_LDFLAGS := -X k8s.io/minikube/pkg/drivers/kvm.version= $( VERSION) -X k8s.io/minikube/pkg/drivers/kvm.gitCommitID= $( COMMIT)
2019-06-28 20:45:54 +00:00
2019-06-29 12:32:21 +00:00
# hyperkit ldflags
HYPERKIT_LDFLAGS := -X k8s.io/minikube/pkg/drivers/hyperkit.version= $( VERSION) -X k8s.io/minikube/pkg/drivers/hyperkit.gitCommitID= $( COMMIT)
2020-08-11 09:59:40 +00:00
# autopush artefacts
AUTOPUSH ?=
2020-07-24 07:07:47 +00:00
2020-08-11 10:01:46 +00:00
# don't ask for user confirmation
2020-08-11 10:15:54 +00:00
IN_CI := false
2020-08-11 10:01:46 +00:00
2020-07-24 07:07:47 +00:00
# $(call user_confirm, message)
d e f i n e u s e r _ c o n f i r m
2020-07-24 22:48:09 +00:00
@if [ " ${ IN_CI } " = "false" ] ; then \
2020-07-25 04:43:55 +00:00
echo " ⚠️ $( 1) " ; \
2020-07-24 07:07:47 +00:00
read -p "Do you want to proceed? (Y/N): " confirm && echo $$ confirm | grep -iq "^[yY]" || exit 1; \
fi
e n d e f
2017-10-19 20:08:53 +00:00
# $(call DOCKER, image, command)
d e f i n e D O C K E R
2019-11-02 14:26:46 +00:00
docker run --rm -e GOCACHE = /app/.cache -e IN_DOCKER = 1 --user $( shell id -u) :$( shell id -g) -w /app -v $( PWD) :/app -v $( GOPATH) :/go --init $( 1) /bin/bash -c '$(2)'
2017-06-28 20:47:54 +00:00
e n d e f
i f e q ( $( BUILD_IN_DOCKER ) , y )
MINIKUBE_BUILD_IN_DOCKER = y
e n d i f
2017-10-03 23:27:52 +00:00
# If we are already running in docker,
2017-06-28 20:47:54 +00:00
# prevent recursion by unsetting the BUILD_IN_DOCKER directives.
# The _BUILD_IN_DOCKER variables should not be modified after this conditional.
i f e q ( $( IN_DOCKER ) , 1 )
MINIKUBE_BUILD_IN_DOCKER = n
e n d i f
2016-09-14 21:01:33 +00:00
i f e q ( $( GOOS ) , w i n d o w s )
2019-09-03 23:45:58 +00:00
IS_EXE = .exe
2019-10-19 07:33:44 +00:00
DIRSEP_ = \\
DIRSEP = $( strip $( DIRSEP_) )
PATHSEP = ;
e l s e
DIRSEP = /
PATHSEP = :
2016-09-14 21:01:33 +00:00
e n d i f
2019-04-13 07:04:11 +00:00
2020-08-30 16:12:21 +00:00
v_at_0 = yes
v_at_ = $( v_at_1)
quiet := $( v_at_$( V) )
Q = $( if $( quiet) ,@)
2019-05-02 19:01:46 +00:00
2020-10-08 19:18:34 +00:00
INTEGRATION_TESTS_TO_RUN := ./test/integration
i f n e q ( $( TEST_FILES ) , )
2020-10-06 05:31:06 +00:00
TEST_HELPERS = main_test.go util_test.go helpers_test.go
2020-10-08 19:18:34 +00:00
INTEGRATION_TESTS_TO_RUN := $( addprefix ./test/integration/, $( TEST_HELPERS) $( TEST_FILES) )
2020-10-06 05:31:06 +00:00
e n d i f
2021-06-17 17:57:00 +00:00
out/minikube$(IS_EXE) : $( SOURCE_FILES ) $( ASSET_FILES ) go .mod
2019-11-02 08:20:54 +00:00
i f e q ( $( MINIKUBE_BUILD_IN_DOCKER ) , y )
2021-03-15 07:52:38 +00:00
$( call DOCKER,$( BUILD_IMAGE) ,GOOS= $( GOOS) GOARCH = $( GOARCH) GOARM = $( GOARM) /usr/bin/make $@ )
2019-11-02 08:20:54 +00:00
e l s e
2020-08-30 16:12:21 +00:00
$( if $( quiet) ,@echo " GO $@ " )
$( Q) go build $( MINIKUBE_GOFLAGS) -tags " $( MINIKUBE_BUILD_TAGS) " -ldflags= " $( MINIKUBE_LDFLAGS) " -o $@ k8s.io/minikube/cmd/minikube
2019-11-02 08:20:54 +00:00
e n d i f
2019-10-19 15:54:33 +00:00
2019-10-24 20:28:18 +00:00
out/minikube-windows-amd64.exe : out /minikube -windows -amd 64
2020-08-30 16:12:21 +00:00
$( if $( quiet) ,@echo " CP $@ " )
$( Q) cp $< $@
2019-10-19 15:54:33 +00:00
2021-04-10 12:39:05 +00:00
out/minikube-linux-i686 : out /minikube -linux -386
$( if $( quiet) ,@echo " CP $@ " )
$( Q) cp $< $@
2019-10-24 20:28:18 +00:00
out/minikube-linux-x86_64 : out /minikube -linux -amd 64
2020-08-30 16:12:21 +00:00
$( if $( quiet) ,@echo " CP $@ " )
$( Q) cp $< $@
2016-05-04 21:29:13 +00:00
2021-03-15 07:52:38 +00:00
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 $< $@
2019-10-24 20:28:18 +00:00
out/minikube-linux-aarch64 : out /minikube -linux -arm 64
2020-08-30 16:12:21 +00:00
$( if $( quiet) ,@echo " CP $@ " )
$( Q) cp $< $@
2017-06-28 20:47:54 +00:00
2021-03-15 06:30:07 +00:00
out/minikube-linux-ppc64el : out /minikube -linux -ppc 64le
$( if $( quiet) ,@echo " CP $@ " )
$( Q) cp $< $@
2021-01-21 19:58:49 +00:00
.PHONY : minikube -linux -amd 64 minikube -linux -arm 64
2021-03-15 06:30:07 +00:00
minikube-linux-amd64 : out /minikube -linux -amd 64 ## Build Minikube for Linux x86 64bit
minikube-linux-arm64 : out /minikube -linux -arm 64 ## Build Minikube for Linux ARM 64bit
2021-01-21 19:58:49 +00:00
2021-01-25 18:56:36 +00:00
.PHONY : minikube -darwin -amd 64 minikube -darwin -arm 64
2021-01-21 19:26:27 +00:00
minikube-darwin-amd64 : out /minikube -darwin -amd 64 ## Build Minikube for Darwin x86 64bit
2021-01-22 07:04:52 +00:00
minikube-darwin-arm64 : out /minikube -darwin -arm 64 ## Build Minikube for Darwin ARM 64bit
2021-01-21 19:58:49 +00:00
.PHONY : minikube -windows -amd 64.exe
2019-10-13 19:23:34 +00:00
minikube-windows-amd64.exe : out /minikube -windows -amd 64.exe ## Build Minikube for Windows 64bit
2017-06-28 20:47:54 +00:00
2021-03-15 07:52:38 +00:00
eq = $( and $( findstring x$( 1) ,x$( 2) ) ,$( findstring x$( 2) ,x$( 1) ) )
2021-06-17 17:57:00 +00:00
out/minikube-% : $( SOURCE_FILES ) $( ASSET_FILES )
2017-06-28 20:47:54 +00:00
i f e q ( $( MINIKUBE_BUILD_IN_DOCKER ) , y )
2017-10-30 17:03:25 +00:00
$( call DOCKER,$( BUILD_IMAGE) ,/usr/bin/make $@ )
2017-02-24 19:03:30 +00:00
e l s e
2020-08-30 16:12:21 +00:00
$( if $( quiet) ,@echo " GO $@ " )
2021-03-16 18:35:52 +00:00
$( Q) GOOS = " $( firstword $( subst -, ,$* ) ) " GOARCH = " $( lastword $( subst -, ,$( subst $( IS_EXE) , ,$* ) ) ) " $( if $( call eq,$( lastword $( subst -, ,$( subst $( IS_EXE) , ,$* ) ) ) ,arm) ,GOARM= $( GOARM) ) \
2019-10-27 07:45:10 +00:00
go build -tags " $( MINIKUBE_BUILD_TAGS) " -ldflags= " $( MINIKUBE_LDFLAGS) " -a -o $@ k8s.io/minikube/cmd/minikube
2017-02-24 19:03:30 +00:00
e n d i f
2016-07-15 19:59:48 +00:00
2021-06-17 17:57:00 +00:00
out/minikube-linux-armv6 : $( SOURCE_FILES ) $( ASSET_FILES )
2021-04-10 12:39:05 +00:00
$( Q) GOOS = linux GOARCH = arm GOARM = 6 \
go build -tags " $( MINIKUBE_BUILD_TAGS) " -ldflags= " $( MINIKUBE_LDFLAGS) " -a -o $@ k8s.io/minikube/cmd/minikube
2021-01-16 00:07:30 +00:00
.PHONY : e 2e -linux -amd 64 e 2e -linux -arm 64 e 2e -darwin -amd 64 e 2e -windows -amd 64.exe
2021-01-22 07:06:22 +00:00
e2e-linux-amd64 : out /e 2e -linux -amd 64 ## build end2end binary for Linux x86 64bit
2021-01-22 07:04:52 +00:00
e2e-linux-arm64 : out /e 2e -linux -arm 64 ## build end2end binary for Linux ARM 64bit
e2e-darwin-amd64 : out /e 2e -darwin -amd 64 ## build end2end binary for Darwin x86 64bit
e2e-darwin-arm64 : out /e 2e -darwin -arm 64 ## build end2end binary for Darwin ARM 64bit
e2e-windows-amd64.exe : out /e 2e -windows -amd 64.exe ## build end2end binary for Windows 64bit
2017-08-23 22:01:52 +00:00
2019-07-31 12:09:47 +00:00
out/e2e-% : out /minikube -%
2020-08-04 19:15:31 +00:00
GOOS = " $( firstword $( subst -, ,$* ) ) " GOARCH = " $( lastword $( subst -, ,$( subst $( IS_EXE) , ,$* ) ) ) " go test -ldflags= " ${ MINIKUBE_LDFLAGS } " -c k8s.io/minikube/test/integration --tags= " $( MINIKUBE_INTEGRATION_BUILD_TAGS) " -o $@
2017-08-23 22:01:52 +00:00
2019-07-31 12:09:47 +00:00
out/e2e-windows-amd64.exe : out /e 2e -windows -amd 64
cp $< $@
2017-08-04 20:52:09 +00:00
2021-04-08 02:36:48 +00:00
minikube_iso : deploy /iso /minikube -iso /board /coreos /minikube /rootfs -overlay /usr /bin /auto -pause # build minikube iso
2017-02-22 19:25:52 +00:00
echo $( ISO_VERSION) > deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/etc/VERSION
2016-11-03 21:22:44 +00:00
if [ ! -d $( BUILD_DIR) /buildroot ] ; then \
mkdir -p $( BUILD_DIR) ; \
2019-02-05 17:18:37 +00:00
git clone --depth= 1 --branch= $( BUILDROOT_BRANCH) https://github.com/buildroot/buildroot $( BUILD_DIR) /buildroot; \
2021-09-21 22:51:10 +00:00
cp deploy/iso/minikube-iso/go.hash $( BUILD_DIR) /buildroot/package/go/go.hash; \
2016-11-03 21:22:44 +00:00
fi ;
2021-09-14 19:42:26 +00:00
$( MAKE) BR2_EXTERNAL = ../../deploy/iso/minikube-iso minikube_defconfig -C $( BUILD_DIR) /buildroot $( BUILDROOT_OPTIONS)
$( MAKE) -C $( BUILD_DIR) /buildroot $( BUILDROOT_OPTIONS) host-python
$( MAKE) -C $( BUILD_DIR) /buildroot $( BUILDROOT_OPTIONS)
2017-02-03 19:59:40 +00:00
mv $( BUILD_DIR) /buildroot/output/images/rootfs.iso9660 $( BUILD_DIR) /minikube.iso
2016-05-27 21:42:42 +00:00
2018-06-08 22:01:16 +00:00
# Change buildroot configuration for the minikube ISO
.PHONY : iso -menuconfig
2019-10-13 19:23:34 +00:00
iso-menuconfig : ## Configure buildroot configuration
2021-09-14 19:42:26 +00:00
$( MAKE) -C $( BUILD_DIR) /buildroot $( BUILDROOT_OPTIONS) menuconfig
$( MAKE) -C $( BUILD_DIR) /buildroot $( BUILDROOT_OPTIONS) savedefconfig
2018-06-08 22:01:16 +00:00
2017-08-28 17:59:42 +00:00
# Change the kernel configuration for the minikube ISO
.PHONY : linux -menuconfig
2019-10-13 19:23:34 +00:00
linux-menuconfig : ## Configure Linux kernel configuration
2018-06-08 22:01:16 +00:00
$( MAKE) -C $( BUILD_DIR) /buildroot/output/build/linux-$( KERNEL_VERSION) / menuconfig
$( MAKE) -C $( BUILD_DIR) /buildroot/output/build/linux-$( KERNEL_VERSION) / savedefconfig
2018-06-07 23:52:57 +00:00
cp $( BUILD_DIR) /buildroot/output/build/linux-$( KERNEL_VERSION) /defconfig deploy/iso/minikube-iso/board/coreos/minikube/linux_defconfig
2017-08-28 17:59:42 +00:00
2019-09-03 23:45:58 +00:00
out/minikube.iso : $( shell find "deploy /iso /minikube -iso " -type f )
2017-03-22 18:00:17 +00:00
i f e q ( $( IN_DOCKER ) , 1 )
$( MAKE) minikube_iso
e l s e
2017-06-27 21:28:50 +00:00
docker run --rm --workdir /mnt --volume $( CURDIR) :/mnt $( ISO_DOCKER_EXTRA_ARGS) \
2017-03-22 18:00:17 +00:00
--user $( shell id -u) :$( shell id -g) --env HOME = /tmp --env IN_DOCKER = 1 \
2021-09-21 19:51:37 +00:00
$( ISO_BUILD_IMAGE) /bin/bash -lc '/usr/bin/make out/minikube.iso'
2017-03-22 18:00:17 +00:00
e n d i f
2018-07-15 01:06:36 +00:00
iso_in_docker :
docker run -it --rm --workdir /mnt --volume $( CURDIR) :/mnt $( ISO_DOCKER_EXTRA_ARGS) \
--user $( shell id -u) :$( shell id -g) --env HOME = /tmp --env IN_DOCKER = 1 \
$( ISO_BUILD_IMAGE) /bin/bash
2021-06-17 17:57:00 +00:00
test-iso :
2020-10-08 19:18:34 +00:00
go test -v $( INTEGRATION_TESTS_TO_RUN) --tags= iso --minikube-start-args= " --iso-url=file:// $( shell pwd ) /out/buildroot/output/images/rootfs.iso9660 "
2017-02-01 19:51:43 +00:00
2017-09-20 04:05:42 +00:00
.PHONY : test -pkg
2021-06-17 17:57:00 +00:00
test-pkg/% : ## Trigger packaging test
2019-05-09 18:46:14 +00:00
go test -v -test.timeout= 60m ./$* --tags= " $( MINIKUBE_BUILD_TAGS) "
2017-09-20 04:05:42 +00:00
2017-10-05 18:55:35 +00:00
.PHONY : all
2021-04-18 10:59:12 +00:00
all : cross drivers e 2e -cross cross -tars exotic retro out /gvisor -addon ## Build all different minikube components
2017-10-05 18:55:35 +00:00
.PHONY : drivers
2021-06-28 17:45:07 +00:00
drivers : ## Build Hyperkit and KVM2 drivers
2021-06-30 21:30:34 +00:00
drivers : docker -machine -driver -hyperkit \
2021-06-28 17:45:07 +00:00
docker-machine-driver-kvm2 \
out/docker-machine-driver-kvm2-amd64 \
out/docker-machine-driver-kvm2-arm64
2019-08-01 10:55:32 +00:00
.PHONY : docker -machine -driver -hyperkit
2019-10-13 19:23:34 +00:00
docker-machine-driver-hyperkit : out /docker -machine -driver -hyperkit ## Build Hyperkit driver
2019-08-01 10:55:32 +00:00
.PHONY : docker -machine -driver -kvm 2
2019-10-13 19:23:34 +00:00
docker-machine-driver-kvm2 : out /docker -machine -driver -kvm 2 ## Build KVM2 driver
2017-10-05 18:55:35 +00:00
2016-05-04 22:29:50 +00:00
.PHONY : integration
2020-09-10 23:08:24 +00:00
integration : out /minikube $( IS_EXE ) ## Trigger minikube integration test, logs to ./out/testout_COMMIT.txt
2020-10-08 19:18:34 +00:00
go test -ldflags= " ${ MINIKUBE_LDFLAGS } " -v -test.timeout= 90m $( INTEGRATION_TESTS_TO_RUN) --tags= " $( MINIKUBE_INTEGRATION_BUILD_TAGS) " $( TEST_ARGS) 2>& 1 | tee " ./out/testout_ $( COMMIT_SHORT) .txt "
2016-05-04 21:29:13 +00:00
2017-08-23 15:52:15 +00:00
.PHONY : integration -none -driver
2020-09-10 23:08:24 +00:00
integration-none-driver : e 2e -linux -$( GOARCH ) out /minikube -linux -$( GOARCH ) ## Trigger minikube none driver test, logs to ./out/testout_COMMIT.txt
2020-09-10 22:55:08 +00:00
sudo -E out/e2e-linux-$( GOARCH) -testdata-dir "test/integration/testdata" -minikube-start-args= "--driver=none" -test.v -test.timeout= 60m -binary= out/minikube-linux-amd64 $( TEST_ARGS) 2>& 1 | tee " ./out/testout_ $( COMMIT_SHORT) .txt "
2017-08-23 15:52:15 +00:00
2017-05-22 22:16:22 +00:00
.PHONY : integration -versioned
2020-09-10 23:08:24 +00:00
integration-versioned : out /minikube ## Trigger minikube integration testing, logs to ./out/testout_COMMIT.txt
2020-10-08 19:18:34 +00:00
go test -ldflags= " ${ MINIKUBE_LDFLAGS } " -v -test.timeout= 90m $( INTEGRATION_TESTS_TO_RUN) --tags= " $( MINIKUBE_INTEGRATION_BUILD_TAGS) versioned " $( TEST_ARGS) 2>& 1 | tee " ./out/testout_ $( COMMIT_SHORT) .txt "
2020-09-10 22:55:08 +00:00
2020-12-09 21:39:48 +00:00
.PHONY : functional
2020-12-09 19:11:45 +00:00
functional : integration -functional -only
2020-09-10 22:55:08 +00:00
.PHONY : integration -functional -only
2020-09-10 23:08:24 +00:00
integration-functional-only : out /minikube $( IS_EXE ) ## Trigger only functioanl tests in integration test, logs to ./out/testout_COMMIT.txt
2020-10-08 19:18:34 +00:00
go test -ldflags= " ${ MINIKUBE_LDFLAGS } " -v -test.timeout= 20m $( INTEGRATION_TESTS_TO_RUN) --tags= " $( MINIKUBE_INTEGRATION_BUILD_TAGS) " $( TEST_ARGS) -test.run TestFunctional 2>& 1 | tee " ./out/testout_ $( COMMIT_SHORT) .txt "
2020-09-10 22:55:08 +00:00
2020-09-10 23:01:33 +00:00
.PHONY : html_report
2020-09-10 23:08:24 +00:00
html_report : ## Generate HTML report out of the last ran integration test logs.
2020-09-10 23:01:15 +00:00
@go tool test2json -t < " ./out/testout_ $( COMMIT_SHORT) .txt " > " ./out/testout_ $( COMMIT_SHORT) .json "
@gopogh -in " ./out/testout_ $( COMMIT_SHORT) .json " -out ./out/testout_$( COMMIT_SHORT) .html -name " $( shell git rev-parse --abbrev-ref HEAD) " -pr "" -repo github.com/kubernetes/minikube/ -details " ${ COMMIT_SHORT } "
@echo "-------------------------- Open HTML Report in Browser: ---------------------------"
2020-09-28 20:42:51 +00:00
i f e q ( $( GOOS ) , w i n d o w s )
@echo start $( CURDIR) /out/testout_$( COMMIT_SHORT) .html
@echo "-----------------------------------------------------------------------------------"
@start $( CURDIR) /out/testout_$( COMMIT_SHORT) .html || true
e l s e
2020-09-10 22:55:08 +00:00
@echo open $( CURDIR) /out/testout_$( COMMIT_SHORT) .html
@echo "-----------------------------------------------------------------------------------"
2020-09-10 23:04:17 +00:00
@open $( CURDIR) /out/testout_$( COMMIT_SHORT) .html || true
2020-09-28 20:42:51 +00:00
e n d i f
2020-09-10 23:01:15 +00:00
2016-05-04 21:29:13 +00:00
.PHONY : test
2021-06-17 17:57:00 +00:00
test : ## Trigger minikube test
2020-04-02 17:48:47 +00:00
MINIKUBE_LDFLAGS = " ${ MINIKUBE_LDFLAGS } " ./test.sh
2016-05-12 17:09:58 +00:00
2020-04-01 23:15:27 +00:00
.PHONY : generate -docs
2021-05-07 22:12:57 +00:00
generate-docs : extract out /minikube ## Automatically generate commands documentation.
2021-05-21 18:07:59 +00:00
out/minikube generate-docs --path ./site/content/en/docs/commands/ --test-path ./site/content/en/docs/contrib/tests.en.md --code-path ./site/content/en/docs/contrib/errorcodes.en.md
2020-04-01 23:15:27 +00:00
2020-04-15 17:51:25 +00:00
.PHONY : gotest
2021-06-17 17:57:00 +00:00
gotest : ## Trigger minikube test
2020-08-30 16:12:21 +00:00
$( if $( quiet) ,@echo " TEST $@ " )
$( Q) go test -tags " $( MINIKUBE_BUILD_TAGS) " -ldflags= " $( MINIKUBE_LDFLAGS) " $( MINIKUBE_TEST_FILES)
2020-04-15 17:51:25 +00:00
2021-04-14 16:14:53 +00:00
# Run the gotest, while recording JSON report and coverage
2021-04-20 19:30:32 +00:00
out/unittest.json : $( SOURCE_FILES ) $( GOTEST_FILES )
2021-04-13 15:24:28 +00:00
$( if $( quiet) ,@echo " TEST $@ " )
2021-04-14 06:19:02 +00:00
$( Q) go test -tags " $( MINIKUBE_BUILD_TAGS) " -ldflags= " $( MINIKUBE_LDFLAGS) " $( MINIKUBE_TEST_FILES) \
2021-04-20 19:30:32 +00:00
-coverprofile= out/coverage.out -json > out/unittest.json
out/coverage.out : out /unittest .json
2021-04-14 16:14:53 +00:00
2021-04-20 10:55:31 +00:00
# Generate go test report (from gotest) as a a HTML page
2021-04-20 19:30:32 +00:00
out/unittest.html : out /unittest .json
2021-04-20 10:55:31 +00:00
$( if $( quiet) ,@echo " REPORT $@ " )
$( Q) go-test-report < $< -o $@
2021-04-14 16:14:53 +00:00
# Generate go coverage report (from gotest) as a HTML page
2021-04-20 19:30:32 +00:00
out/coverage.html : out /coverage .out
2021-04-13 15:24:28 +00:00
$( if $( quiet) ,@echo " COVER $@ " )
$( Q) go tool cover -html= $< -o $@
2021-05-07 22:12:57 +00:00
.PHONY : extract
extract : ## extract internationalization words for translations
2020-04-01 23:15:27 +00:00
go run cmd/extract/extract.go
2020-01-19 21:29:30 +00:00
2016-07-08 16:23:03 +00:00
.PHONY : cross
2020-02-23 15:11:49 +00:00
cross : minikube -linux -amd 64 minikube -darwin -amd 64 minikube -windows -amd 64.exe ## Build minikube for all platform
.PHONY : exotic
exotic : out /minikube -linux -arm out /minikube -linux -arm 64 out /minikube -linux -ppc 64le out /minikube -linux -s 390x ## Build minikube for non-amd64 linux
2016-07-08 16:23:03 +00:00
2021-04-18 10:59:12 +00:00
.PHONY : retro
retro : out /minikube -linux -386 out /minikube -linux -armv 6 ## Build minikube for legacy 32-bit linux
2019-06-25 18:02:07 +00:00
.PHONY : windows
2019-10-13 19:23:34 +00:00
windows : minikube -windows -amd 64.exe ## Build minikube for Windows 64bit
2019-06-25 18:02:07 +00:00
.PHONY : darwin
2019-10-13 19:23:34 +00:00
darwin : minikube -darwin -amd 64 ## Build minikube for Darwin 64bit
2019-06-25 18:02:07 +00:00
.PHONY : linux
2019-10-13 19:23:34 +00:00
linux : minikube -linux -amd 64 ## Build minikube for Linux 64bit
2019-06-25 18:02:07 +00:00
2017-08-23 22:01:52 +00:00
.PHONY : e 2e -cross
2021-01-16 00:07:30 +00:00
e2e-cross : e 2e -linux -amd 64 e 2e -linux -arm 64 e 2e -darwin -amd 64 e 2e -windows -amd 64.exe ## End-to-end cross test
2017-08-04 20:52:09 +00:00
2017-02-03 19:59:40 +00:00
.PHONY : checksum
2019-10-13 19:23:34 +00:00
checksum : ## Generate checksums
2020-02-23 15:11:49 +00:00
for f in out/minikube.iso out/minikube-linux-amd64 out/minikube-linux-arm \
out/minikube-linux-arm64 out/minikube-linux-ppc64le out/minikube-linux-s390x \
2019-10-19 15:54:33 +00:00
out/minikube-darwin-amd64 out/minikube-windows-amd64.exe \
2021-06-25 03:02:21 +00:00
out/docker-machine-driver-kvm2 out/docker-machine-driver-kvm2-amd64 out/docker-machine-driver-kvm2-arm64 \
out/docker-machine-driver-hyperkit; do \
2016-07-22 11:23:57 +00:00
if [ -f " $$ {f} " ] ; then \
openssl sha256 " $$ {f} " | awk '{print $$2}' > " $$ {f}.sha256 " ; \
fi ; \
done
2016-07-07 18:29:31 +00:00
.PHONY : clean
2019-10-13 19:23:34 +00:00
clean : ## Clean build
2016-07-04 10:10:44 +00:00
rm -rf $( BUILD_DIR)
2016-09-29 00:35:42 +00:00
rm -f pkg/minikube/assets/assets.go
2019-06-24 22:15:01 +00:00
rm -f pkg/minikube/translate/translations.go
2019-05-30 19:43:48 +00:00
rm -rf ./vendor
2020-12-20 03:09:47 +00:00
rm -rf /tmp/tmp.*.minikube_*
2016-07-08 16:38:23 +00:00
.PHONY : gendocs
2019-10-13 19:23:34 +00:00
gendocs : out /docs /minikube .md ## Generate documentation
2016-07-08 16:38:23 +00:00
2018-02-11 18:07:52 +00:00
.PHONY : fmt
2019-10-13 19:23:34 +00:00
fmt : ## Run go fmt and modify files in place
2019-06-22 12:47:28 +00:00
@gofmt -s -w $( SOURCE_DIRS)
.PHONY : gofmt
2019-10-13 19:23:34 +00:00
gofmt : ## Run go fmt and list the files differs from gofmt's
2019-06-22 12:47:28 +00:00
@gofmt -s -l $( SOURCE_DIRS)
@test -z " `gofmt -s -l $( SOURCE_DIRS) ` "
2018-02-11 18:07:52 +00:00
2019-03-23 11:51:13 +00:00
.PHONY : vet
2019-10-13 19:23:34 +00:00
vet : ## Run go vet
2019-03-23 11:51:13 +00:00
@go vet $( SOURCE_PACKAGES)
2021-01-28 10:25:33 +00:00
.PHONY : imports
imports : ## Run goimports and modify files in place
@goimports -w $( SOURCE_DIRS)
.PHONY : goimports
goimports : ## Run goimports and list the files differs from goimport's
@goimports -l $( SOURCE_DIRS)
@test -z " `goimports -l $( SOURCE_DIRS) ` "
2019-06-22 12:34:18 +00:00
.PHONY : golint
2021-06-17 17:57:00 +00:00
golint : ## Run golint
2019-06-22 12:34:18 +00:00
@golint -set_exit_status $( SOURCE_PACKAGES)
.PHONY : gocyclo
2019-10-13 19:23:34 +00:00
gocyclo : ## Run gocyclo (calculates cyclomatic complexities)
2019-06-22 12:34:18 +00:00
@gocyclo -over 15 ` find $( SOURCE_DIRS) -type f -name "*.go" `
2019-09-13 21:07:07 +00:00
out/linters/golangci-lint-$(GOLINT_VERSION) :
2019-05-22 01:25:12 +00:00
mkdir -p out/linters
2019-06-20 08:15:23 +00:00
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b out/linters $( GOLINT_VERSION)
2019-09-13 21:07:07 +00:00
mv out/linters/golangci-lint out/linters/golangci-lint-$( GOLINT_VERSION)
2019-05-14 04:43:52 +00:00
2019-07-24 17:34:53 +00:00
# this one is meant for local use
2019-03-02 20:21:31 +00:00
.PHONY : lint
2020-03-02 21:51:44 +00:00
i f e q ( $( MINIKUBE_BUILD_IN_DOCKER ) , y )
2021-06-17 17:57:00 +00:00
lint :
2020-03-02 21:51:44 +00:00
docker run --rm -v $( pwd ) :/app -w /app golangci/golangci-lint:$( GOLINT_VERSION) \
golangci-lint run ${ GOLINT_OPTIONS } --skip-dirs "cmd/drivers/kvm|cmd/drivers/hyperkit|pkg/drivers/kvm|pkg/drivers/hyperkit" ./...
e l s e
2021-06-17 17:57:00 +00:00
lint : out /linters /golangci -lint -$( GOLINT_VERSION ) ## Run lint
2019-09-13 21:07:07 +00:00
./out/linters/golangci-lint-$( GOLINT_VERSION) run ${ GOLINT_OPTIONS } ./...
2020-03-02 21:51:44 +00:00
e n d i f
2019-07-24 17:34:53 +00:00
# lint-ci is slower version of lint and is meant to be used in ci (travis) to avoid out of memory leaks.
.PHONY : lint -ci
2021-06-17 17:57:00 +00:00
lint-ci : out /linters /golangci -lint -$( GOLINT_VERSION ) ## Run lint-ci
2019-09-13 21:42:56 +00:00
GOGC = ${ GOLINT_GOGC } ./out/linters/golangci-lint-$( GOLINT_VERSION) run \
2019-07-24 17:34:53 +00:00
--concurrency ${ GOLINT_JOBS } ${ GOLINT_OPTIONS } ./...
2019-03-02 20:21:31 +00:00
2019-03-10 13:40:46 +00:00
.PHONY : reportcard
2019-10-13 19:23:34 +00:00
reportcard : ## Run goreportcard for minikube
2019-03-10 13:40:46 +00:00
goreportcard-cli -v
# "disabling misspell on large repo..."
-misspell -error $( SOURCE_DIRS)
2019-03-10 11:09:21 +00:00
.PHONY : mdlint
mdlint :
@$( MARKDOWNLINT) $( MINIKUBE_MARKDOWN_FILES)
2020-04-21 17:59:01 +00:00
.PHONY : verify -iso
verify-iso : # Make sure the current ISO exists in the expected bucket
gsutil stat gs://$( ISO_BUCKET) /minikube-$( ISO_VERSION) .iso
2021-06-17 17:57:00 +00:00
out/docs/minikube.md : $( shell find "cmd ") $( shell find "pkg /minikube /constants ")
2019-07-11 13:35:16 +00:00
go run -ldflags= " $( MINIKUBE_LDFLAGS) " -tags gendocs hack/help_text/gen_help_text.go
2016-08-12 22:46:22 +00:00
2021-02-16 19:17:53 +00:00
.PHONY : debs ## Build all deb packages
2021-02-12 23:01:53 +00:00
debs : out /minikube_ $( DEB_VERSION ) -$( DEB_REVISION ) _amd 64.deb \
out/minikube_$( DEB_VERSION) -$( DEB_REVISION) _arm64.deb \
2021-06-25 03:02:21 +00:00
out/docker-machine-driver-kvm2_$( DEB_VERSION) .deb \
out/docker-machine-driver-kvm2_$( DEB_VERSION) -$( DEB_REVISION) _amd64.deb \
out/docker-machine-driver-kvm2_$( DEB_VERSION) -$( DEB_REVISION) _arm64.deb
2021-02-12 23:01:53 +00:00
2021-01-27 19:33:45 +00:00
.PHONY : deb_version
2020-02-02 12:37:47 +00:00
deb_version :
2020-12-18 16:01:17 +00:00
@echo $( DEB_VERSION) -$( DEB_REVISION)
2020-02-02 12:37:47 +00:00
2021-01-27 19:33:45 +00:00
.PHONY : deb_version_base
deb_version_base :
2020-02-02 12:37:47 +00:00
@echo $( DEB_VERSION)
2020-12-18 16:01:17 +00:00
out/minikube_$(DEB_VERSION).deb : out /minikube_ $( DEB_VERSION ) -$( DEB_REVISION ) _amd 64.deb
2019-10-19 15:54:33 +00:00
cp $< $@
2020-12-18 16:01:17 +00:00
out/minikube_$(DEB_VERSION)-$(DEB_REVISION)_%.deb : out /minikube -linux -%
2020-12-20 03:09:47 +00:00
$( eval DEB_PACKAGING_DIRECTORY_$* = $( shell mktemp -d --suffix " .minikube_ $( DEB_VERSION) - $* -deb " ) )
cp -r installers/linux/deb/minikube_deb_template/* $( DEB_PACKAGING_DIRECTORY_$* ) /
chmod 0755 $( DEB_PACKAGING_DIRECTORY_$* ) /DEBIAN
sed -E -i 's/--VERSION--/' $( DEB_VERSION) '/g' $( DEB_PACKAGING_DIRECTORY_$* ) /DEBIAN/control
2021-02-22 19:24:47 +00:00
sed -E -i 's/--REVISION--/' $( DEB_REVISION) '/g' $( DEB_PACKAGING_DIRECTORY_$* ) /DEBIAN/control
2020-12-20 03:09:47 +00:00
sed -E -i 's/--ARCH--/' $* '/g' $( DEB_PACKAGING_DIRECTORY_$* ) /DEBIAN/control
2021-01-25 16:40:47 +00:00
2020-12-01 16:11:08 +00:00
if [ " $* " = "amd64" ] ; then \
2020-12-20 03:09:47 +00:00
sed -E -i 's/--RECOMMENDS--/virtualbox/' $( DEB_PACKAGING_DIRECTORY_$* ) /DEBIAN/control; \
2020-12-01 16:11:08 +00:00
else \
2020-12-20 03:09:47 +00:00
sed -E -i '/Recommends: --RECOMMENDS--/d' $( DEB_PACKAGING_DIRECTORY_$* ) /DEBIAN/control; \
2020-12-01 16:11:08 +00:00
fi
2021-01-25 16:40:47 +00:00
2020-12-20 03:09:47 +00:00
mkdir -p $( DEB_PACKAGING_DIRECTORY_$* ) /usr/bin
cp $< $( DEB_PACKAGING_DIRECTORY_$* ) /usr/bin/minikube
fakeroot dpkg-deb --build $( DEB_PACKAGING_DIRECTORY_$* ) $@
rm -rf $( DEB_PACKAGING_DIRECTORY_$* )
2016-09-07 23:44:01 +00:00
2020-02-02 12:37:47 +00:00
rpm_version :
2021-01-22 23:18:17 +00:00
@echo $( RPM_VERSION) -$( RPM_REVISION)
2020-02-02 12:37:47 +00:00
2020-12-18 16:01:17 +00:00
out/minikube-$(RPM_VERSION).rpm : out /minikube -$( RPM_VERSION ) -$( RPM_REVISION ) .x 86_ 64.rpm
2019-10-19 15:54:33 +00:00
cp $< $@
out/minikube-$(RPM_VERSION)-0.%.rpm : out /minikube -linux -%
2020-12-20 03:09:47 +00:00
$( eval RPM_PACKAGING_DIRECTORY_$* = $( shell mktemp -d --suffix " .minikube_ $( RPM_VERSION) - $* -rpm " ) )
cp -r installers/linux/rpm/minikube_rpm_template/* $( RPM_PACKAGING_DIRECTORY_$* ) /
sed -E -i 's/--VERSION--/' $( RPM_VERSION) '/g' $( RPM_PACKAGING_DIRECTORY_$* ) /minikube.spec
2021-02-22 19:24:47 +00:00
sed -E -i 's/--REVISION--/' $( RPM_REVISION) '/g' $( RPM_PACKAGING_DIRECTORY_$* ) /minikube.spec
2020-12-20 03:09:47 +00:00
sed -E -i 's|--OUT--|' $( PWD) /out'|g' $( RPM_PACKAGING_DIRECTORY_$* ) /minikube.spec
2019-10-19 15:54:33 +00:00
rpmbuild -bb -D " _rpmdir $( PWD) /out " --target $* \
2020-12-20 03:09:47 +00:00
$( RPM_PACKAGING_DIRECTORY_$* ) /minikube.spec
2020-12-18 16:01:17 +00:00
@mv out/$* /minikube-$( RPM_VERSION) -$( RPM_REVISION) .$* .rpm out/ && rmdir out/$*
2020-12-20 03:09:47 +00:00
rm -rf $( RPM_PACKAGING_DIRECTORY_$* )
2019-02-24 14:46:43 +00:00
2019-07-13 19:37:24 +00:00
.PHONY : apt
2019-10-13 19:23:34 +00:00
apt : out /Release ## Generate apt package file
2019-07-13 19:37:24 +00:00
out/Release : out /minikube_ $( DEB_VERSION ) .deb
( cd out && apt-ftparchive packages . ) | gzip -c > out/Packages.gz
( cd out && apt-ftparchive release . ) > out/Release
.PHONY : yum
yum : out /repodata /repomd .xml
out/repodata/repomd.xml : out /minikube -$( RPM_VERSION ) .rpm
createrepo --simple-md-filenames --no-database \
-u " $( MINIKUBE_RELEASES_URL) / $( VERSION) / " out
2017-07-25 18:24:50 +00:00
.SECONDEXPANSION :
2019-10-19 15:54:33 +00:00
TAR_TARGETS_linux-amd64 := out/minikube-linux-amd64 out/docker-machine-driver-kvm2
2021-05-09 08:07:28 +00:00
TAR_TARGETS_linux-arm64 := out/minikube-linux-arm64 #out/docker-machine-driver-kvm2
2019-10-19 15:54:33 +00:00
TAR_TARGETS_darwin-amd64 := out/minikube-darwin-amd64 out/docker-machine-driver-hyperkit
2021-05-09 08:07:28 +00:00
TAR_TARGETS_darwin-arm64 := out/minikube-darwin-arm64 #out/docker-machine-driver-hyperkit
2019-10-19 15:54:33 +00:00
TAR_TARGETS_windows-amd64 := out/minikube-windows-amd64.exe
out/minikube-%.tar.gz : $$( TAR_TARGETS_ $ $ *)
2020-08-30 16:12:21 +00:00
$( if $( quiet) ,@echo " TAR $@ " )
$( Q) tar -cvzf $@ $^
2017-09-19 21:01:15 +00:00
.PHONY : cross -tars
2020-02-23 15:11:49 +00:00
cross-tars : out /minikube -linux -amd 64.tar .gz out /minikube -windows -amd 64.tar .gz out /minikube -darwin -amd 64.tar .gz ## Cross-compile minikube
2019-07-13 19:33:56 +00:00
-cd out && $( SHA512SUM) *.tar.gz > SHA512SUM
2017-10-03 23:27:52 +00:00
2016-09-07 23:44:01 +00:00
out/minikube-installer.exe : out /minikube -windows -amd 64.exe
rm -rf out/windows_tmp
cp -r installers/windows/ out/windows_tmp
cp -r LICENSE out/windows_tmp/LICENSE
awk 'sub("$$", "\r")' out/windows_tmp/LICENSE > out/windows_tmp/LICENSE.txt
sed -E -i 's/--VERSION_MAJOR--/' $( VERSION_MAJOR) '/g' out/windows_tmp/minikube.nsi
sed -E -i 's/--VERSION_MINOR--/' $( VERSION_MINOR) '/g' out/windows_tmp/minikube.nsi
sed -E -i 's/--VERSION_BUILD--/' $( VERSION_BUILD) '/g' out/windows_tmp/minikube.nsi
sed -E -i 's/--INSTALL_SIZE--/' $( INSTALL_SIZE) '/g' out/windows_tmp/minikube.nsi
cp out/minikube-windows-amd64.exe out/windows_tmp/minikube.exe
makensis out/windows_tmp/minikube.nsi
mv out/windows_tmp/minikube-installer.exe out/minikube-installer.exe
rm -rf out/windows_tmp
2016-09-23 19:00:23 +00:00
2019-08-12 21:42:11 +00:00
out/docker-machine-driver-hyperkit :
2017-08-15 04:02:55 +00:00
i f e q ( $( MINIKUBE_BUILD_IN_DOCKER ) , y )
2019-11-02 14:26:46 +00:00
docker run --rm -e GOCACHE = /app/.cache -e IN_DOCKER = 1 \
--user $( shell id -u) :$( shell id -g) -w /app \
-v $( PWD) :/app -v $( GOPATH) :/go --init --entrypoint "" \
$( HYPERKIT_BUILD_IMAGE) /bin/bash -c 'CC=o64-clang CXX=o64-clang++ /usr/bin/make $@'
2017-08-15 04:02:55 +00:00
e l s e
2020-08-30 16:12:21 +00:00
$( if $( quiet) ,@echo " GO $@ " )
$( Q) GOOS = darwin CGO_ENABLED = 1 go build \
2019-06-29 12:32:21 +00:00
-ldflags= " $( HYPERKIT_LDFLAGS) " \
2019-07-31 12:13:37 +00:00
-o $@ k8s.io/minikube/cmd/drivers/hyperkit
2017-08-15 04:02:55 +00:00
e n d i f
2017-05-22 20:19:25 +00:00
2019-07-13 19:26:23 +00:00
hyperkit_in_docker :
rm -f out/docker-machine-driver-hyperkit
2019-11-02 14:26:46 +00:00
$( MAKE) MINIKUBE_BUILD_IN_DOCKER = y out/docker-machine-driver-hyperkit
2019-07-13 19:26:23 +00:00
2017-05-22 20:19:25 +00:00
.PHONY : install -hyperkit -driver
2019-10-13 19:23:34 +00:00
install-hyperkit-driver : out /docker -machine -driver -hyperkit ## Install hyperkit to local machine
2019-08-01 10:55:12 +00:00
mkdir -p $( HOME) /bin
2017-10-20 15:37:21 +00:00
sudo cp out/docker-machine-driver-hyperkit $( HOME) /bin/docker-machine-driver-hyperkit
sudo chown root:wheel $( HOME) /bin/docker-machine-driver-hyperkit
sudo chmod u+s $( HOME) /bin/docker-machine-driver-hyperkit
2017-05-22 20:19:25 +00:00
2019-07-13 19:26:23 +00:00
.PHONY : release -hyperkit -driver
2019-10-13 19:23:34 +00:00
release-hyperkit-driver : install -hyperkit -driver checksum ## Copy hyperkit using gsutil
2019-07-13 19:26:23 +00:00
gsutil cp $( GOBIN) /docker-machine-driver-hyperkit gs://minikube/drivers/hyperkit/$( VERSION) /
gsutil cp $( GOBIN) /docker-machine-driver-hyperkit.sha256 gs://minikube/drivers/hyperkit/$( VERSION) /
2016-09-23 19:00:23 +00:00
.PHONY : check -release
2021-06-17 17:57:00 +00:00
check-release : ## Execute go test
2021-06-29 23:38:44 +00:00
go test -timeout 42m -v ./deploy/minikube/release_sanity_test.go
2016-11-29 19:55:49 +00:00
2017-03-22 18:00:17 +00:00
buildroot-image : $( ISO_BUILD_IMAGE ) # convenient alias to build the docker container
$(ISO_BUILD_IMAGE) : deploy /iso /minikube -iso /Dockerfile
2017-06-27 21:28:50 +00:00
docker build $( ISO_DOCKER_EXTRA_ARGS) -t $@ -f $< $( dir $<)
2017-03-22 18:00:17 +00:00
@echo ""
2017-06-16 12:26:51 +00:00
@echo " $( @) successfully built "
2017-03-22 18:00:17 +00:00
2020-01-09 19:25:01 +00:00
out/storage-provisioner : out /storage -provisioner -$( GOARCH )
2020-08-30 16:12:21 +00:00
$( if $( quiet) ,@echo " CP $@ " )
$( Q) cp $< $@
2017-10-30 20:07:48 +00:00
2020-01-09 19:25:01 +00:00
out/storage-provisioner-% : cmd /storage -provisioner /main .go pkg /storage /storage_provisioner .go
i f e q ( $( MINIKUBE_BUILD_IN_DOCKER ) , y )
$( call DOCKER,$( BUILD_IMAGE) ,/usr/bin/make $@ )
2019-04-13 07:04:11 +00:00
e l s e
2020-08-30 16:12:21 +00:00
$( if $( quiet) ,@echo " GO $@ " )
$( Q) CGO_ENABLED = 0 GOOS = linux GOARCH = $* go build -o $@ -ldflags= $( PROVISIONER_LDFLAGS) cmd/storage-provisioner/main.go
2019-04-13 07:04:11 +00:00
e n d i f
2017-11-06 18:12:10 +00:00
2020-01-09 19:25:01 +00:00
.PHONY : storage -provisioner -image
2020-09-27 17:00:35 +00:00
storage-provisioner-image : storage -provisioner -image -$( GOARCH ) ## Build storage-provisioner docker image
docker tag $( REGISTRY) /storage-provisioner-$( GOARCH) :$( STORAGE_PROVISIONER_TAG) $( REGISTRY) /storage-provisioner:$( STORAGE_PROVISIONER_TAG)
storage-provisioner-image-% : out /storage -provisioner -%
docker build -t $( REGISTRY) /storage-provisioner-$* :$( STORAGE_PROVISIONER_TAG) -f deploy/storage-provisioner/Dockerfile --build-arg arch = $* .
2020-01-09 19:25:01 +00:00
2020-02-07 19:15:34 +00:00
2020-12-14 02:59:19 +00:00
X_DOCKER_BUILDER ?= minikube-builder
X_BUILD_ENV ?= DOCKER_CLI_EXPERIMENTAL = enabled
2020-12-14 03:21:45 +00:00
2020-12-14 02:59:19 +00:00
.PHONY : docker -multi -arch -builder
docker-multi-arch-builder :
env $( X_BUILD_ENV) docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
2021-01-08 19:49:10 +00:00
env $( X_BUILD_ENV) docker buildx rm --builder $( X_DOCKER_BUILDER) || true
2021-02-02 00:11:16 +00:00
env $( X_BUILD_ENV) docker buildx create --name $( X_DOCKER_BUILDER) --buildkitd-flags '--debug' || true
2020-12-14 02:59:19 +00:00
2021-12-08 00:05:32 +00:00
KICBASE_ARCH ?= linux/amd64,linux/arm64,linux/s390x,linux/arm,linux/ppc64le
2021-04-27 00:54:07 +00:00
KICBASE_IMAGE_GCR ?= $( REGISTRY) /kicbase:$( KIC_VERSION)
KICBASE_IMAGE_HUB ?= kicbase/stable:$( KIC_VERSION)
KICBASE_IMAGE_REGISTRIES ?= $( KICBASE_IMAGE_GCR) $( KICBASE_IMAGE_HUB)
2020-12-14 03:21:45 +00:00
2021-06-15 21:22:04 +00:00
.PHONY : local -kicbase
2021-06-22 23:04:50 +00:00
local-kicbase : ## Builds the kicbase image and tags it local/kicbase:latest and local/kicbase:$(KIC_VERSION)-$(COMMIT_SHORT)
2021-06-22 21:49:53 +00:00
docker build -f ./deploy/kicbase/Dockerfile -t local/kicbase:$( KIC_VERSION) --build-arg COMMIT_SHA = ${ VERSION } -$( COMMIT) --cache-from $( KICBASE_IMAGE_GCR) .
2021-06-15 21:22:04 +00:00
docker tag local/kicbase:$( KIC_VERSION) local/kicbase:latest
docker tag local/kicbase:$( KIC_VERSION) local/kicbase:$( KIC_VERSION) -$( COMMIT_SHORT)
SED = sed -i
i f e q ( $( GOOS ) , d a r w i n )
SED = sed -i ''
e n d i f
.PHONY : local -kicbase -debug
local-kicbase-debug : local -kicbase ## Builds a local kicbase image and switches source code to point to it
$( SED) 's|Version = .*|Version = \"$(KIC_VERSION)-$(COMMIT_SHORT)\"|;s|baseImageSHA = .*|baseImageSHA = \"\"|;s|gcrRepo = .*|gcrRepo = \"local/kicbase\"|;s|dockerhubRepo = .*|dockerhubRepo = \"local/kicbase\"|' pkg/drivers/kic/types.go
2021-07-30 15:50:21 +00:00
.PHONY : build -kic -base -image
build-kic-base-image : docker -multi -arch -builder ## Build multi-arch local/kicbase:latest
env $( X_BUILD_ENV) docker buildx build -f ./deploy/kicbase/Dockerfile --builder $( X_DOCKER_BUILDER) --platform $( KICBASE_ARCH) $( addprefix -t ,$( KICBASE_IMAGE_REGISTRIES) ) --load --build-arg COMMIT_SHA = ${ VERSION } -$( COMMIT) .
2021-01-08 19:31:14 +00:00
.PHONY : push -kic -base -image
2021-06-22 23:04:50 +00:00
push-kic-base-image : docker -multi -arch -builder ## Push multi-arch local/kicbase:latest to all remote registries
2020-12-14 05:10:51 +00:00
i f d e f A U T O P U S H
docker login gcr.io/k8s-minikube
docker login docker.pkg.github.com
docker login
2021-01-08 19:49:10 +00:00
e n d i f
$( foreach REG,$( KICBASE_IMAGE_REGISTRIES) , \
@docker pull $( REG) && echo "Image already exist in registry" && exit 1 || echo "Image doesn't exist in registry" ; )
2021-04-27 00:54:07 +00:00
i f n d e f C I B U I L D
2021-01-08 19:49:10 +00:00
$( call user_confirm, 'Are you sure you want to push $(KICBASE_IMAGE_REGISTRIES) ?' )
2020-12-14 05:10:51 +00:00
e n d i f
2021-06-22 23:58:12 +00:00
env $( X_BUILD_ENV) docker buildx build -f ./deploy/kicbase/Dockerfile --builder $( X_DOCKER_BUILDER) --platform $( KICBASE_ARCH) $( addprefix -t ,$( KICBASE_IMAGE_REGISTRIES) ) --push --build-arg COMMIT_SHA = ${ VERSION } -$( COMMIT) .
2020-12-14 02:59:19 +00:00
2021-04-20 18:24:49 +00:00
out/preload-tool :
2021-04-13 19:18:44 +00:00
go build -ldflags= " $( MINIKUBE_LDFLAGS) " -o $@ ./hack/preload-images/*.go
2020-02-20 19:55:47 +00:00
.PHONY : upload -preloaded -images -tar
2021-04-20 18:24:49 +00:00
upload-preloaded-images-tar : out /minikube out /preload -tool ## Upload the preloaded images for oldest supported, newest supported, and default kubernetes versions to GCS.
out/preload-tool
2020-01-08 21:52:07 +00:00
2021-04-13 19:18:44 +00:00
.PHONY : generate -preloaded -images -tar
2021-04-20 18:24:49 +00:00
generate-preloaded-images-tar : out /minikube out /preload -tool ## Generates the preloaded images for oldest supported, newest supported, and default kubernetes versions
out/preload-tool --no-upload
2017-10-30 20:07:48 +00:00
2020-09-27 17:00:35 +00:00
ALL_ARCH = amd64 arm arm64 ppc64le s390x
IMAGE = $( REGISTRY) /storage-provisioner
TAG = $( STORAGE_PROVISIONER_TAG)
.PHONY : push -storage -provisioner -manifest
2021-03-29 19:52:35 +00:00
push-storage-provisioner-manifest : $( shell echo $ ( ALL_ARCH ) | sed -e "s ~[^ ]*~storage \-provisioner \-image \-&~g ") ## Push multi-arch storage-provisioner image
2021-05-13 16:40:55 +00:00
i f n d e f C I B U I L D
2020-09-27 17:00:35 +00:00
docker login gcr.io/k8s-minikube
2021-05-13 16:40:55 +00:00
e n d i f
2020-09-27 17:00:35 +00:00
set -x; for arch in $( ALL_ARCH) ; do docker push ${ IMAGE } -$$ { arch} :${ TAG } ; done
2021-05-13 17:30:12 +00:00
$( X_BUILD_ENV) docker manifest create --amend $( IMAGE) :$( TAG) $( shell echo $( ALL_ARCH) | sed -e " s~[^ ]*~ $( IMAGE) \-&: $( TAG) ~g " )
2021-05-13 17:33:20 +00:00
set -x; for arch in $( ALL_ARCH) ; do $( X_BUILD_ENV) docker manifest annotate --arch $$ { arch} ${ IMAGE } :${ TAG } ${ IMAGE } -$$ { arch} :${ TAG } ; done
2021-05-13 17:30:12 +00:00
$( X_BUILD_ENV) docker manifest push $( STORAGE_PROVISIONER_MANIFEST)
2020-09-27 17:00:35 +00:00
2020-08-11 09:59:40 +00:00
.PHONY : push -docker
2020-11-05 23:07:56 +00:00
push-docker : # Push docker image base on to IMAGE variable (used internally by other targets)
2020-08-12 23:35:57 +00:00
@docker pull $( IMAGE) && echo "Image already exist in registry" && exit 1 || echo "Image doesn't exist in registry"
2020-08-11 09:59:40 +00:00
i f n d e f A U T O P U S H
$( call user_confirm, 'Are you sure you want to push $(IMAGE) ?' )
e n d i f
2020-08-12 00:07:18 +00:00
docker push $( IMAGE)
2020-08-11 09:59:40 +00:00
2018-12-07 23:27:22 +00:00
.PHONY : out /gvisor -addon
2021-06-17 17:57:00 +00:00
out/gvisor-addon : ## Build gvisor addon
2020-08-30 16:12:21 +00:00
$( if $( quiet) ,@echo " GO $@ " )
$( Q) GOOS = linux CGO_ENABLED = 0 go build -o $@ cmd/gvisor/gvisor.go
2018-12-07 23:27:22 +00:00
.PHONY : gvisor -addon -image
2019-10-13 19:23:34 +00:00
gvisor-addon-image : out /gvisor -addon ## Build docker image for gvisor
2020-02-06 14:43:12 +00:00
docker build -t $( REGISTRY) /gvisor-addon:$( GVISOR_TAG) -f deploy/gvisor/Dockerfile .
2018-12-07 23:27:22 +00:00
.PHONY : push -gvisor -addon -image
push-gvisor-addon-image : gvisor -addon -image
2020-08-14 10:24:42 +00:00
docker login gcr.io/k8s-minikube
$( MAKE) push-docker IMAGE = $( REGISTRY) /gvisor-addon:$( GVISOR_TAG)
2018-12-07 23:27:22 +00:00
2017-02-03 19:59:40 +00:00
.PHONY : release -iso
2019-10-13 19:23:34 +00:00
release-iso : minikube_iso checksum ## Build and release .iso file
2017-02-10 22:43:54 +00:00
gsutil cp out/minikube.iso gs://$( ISO_BUCKET) /minikube-$( ISO_VERSION) .iso
gsutil cp out/minikube.iso.sha256 gs://$( ISO_BUCKET) /minikube-$( ISO_VERSION) .iso.sha256
2017-08-22 22:31:54 +00:00
2018-06-24 06:07:13 +00:00
.PHONY : release -minikube
2019-10-13 19:23:34 +00:00
release-minikube : out /minikube checksum ## Minikube release
2018-06-24 06:07:13 +00:00
gsutil cp out/minikube-$( GOOS) -$( GOARCH) $( MINIKUBE_UPLOAD_LOCATION) /$( MINIKUBE_VERSION) /minikube-$( GOOS) -$( GOARCH)
gsutil cp out/minikube-$( GOOS) -$( GOARCH) .sha256 $( MINIKUBE_UPLOAD_LOCATION) /$( MINIKUBE_VERSION) /minikube-$( GOOS) -$( GOARCH) .sha256
2021-05-21 16:31:45 +00:00
.PHONY : release -notes
release-notes :
hack/release_notes.sh
.PHONY : update -leaderboard
update-leaderboard :
hack/update_contributions.sh
2021-06-21 23:09:36 +00:00
out/docker-machine-driver-kvm2 : out /docker -machine -driver -kvm 2-$( GOARCH )
2020-08-30 16:12:21 +00:00
$( if $( quiet) ,@echo " CP $@ " )
$( Q) cp $< $@
2020-02-02 12:55:07 +00:00
2020-02-03 21:15:02 +00:00
out/docker-machine-driver-kvm2-x86_64 : out /docker -machine -driver -kvm 2-amd 64
2020-08-30 16:12:21 +00:00
$( if $( quiet) ,@echo " CP $@ " )
$( Q) cp $< $@
2020-02-03 21:15:02 +00:00
out/docker-machine-driver-kvm2-aarch64 : out /docker -machine -driver -kvm 2-arm 64
2020-08-30 16:12:21 +00:00
$( if $( quiet) ,@echo " CP $@ " )
$( Q) cp $< $@
2020-02-03 21:15:02 +00:00
2017-08-22 22:31:54 +00:00
2020-02-02 12:55:07 +00:00
out/docker-machine-driver-kvm2_$(DEB_VERSION).deb : out /docker -machine -driver -kvm 2_ $( DEB_VERSION ) -0_amd 64.deb
cp $< $@
2021-06-25 03:02:21 +00:00
2020-02-02 12:55:07 +00:00
out/docker-machine-driver-kvm2_$(DEB_VERSION)-0_%.deb : out /docker -machine -driver -kvm 2-%
2019-06-22 11:17:20 +00:00
cp -r installers/linux/deb/kvm2_deb_template out/docker-machine-driver-kvm2_$( DEB_VERSION)
chmod 0755 out/docker-machine-driver-kvm2_$( DEB_VERSION) /DEBIAN
2021-06-25 03:02:21 +00:00
sed -E -i -e 's/--VERSION--/$(DEB_VERSION)/g' out/docker-machine-driver-kvm2_$( DEB_VERSION) /DEBIAN/control
sed -E -i -e 's/--ARCH--/' $* '/g' out/docker-machine-driver-kvm2_$( DEB_VERSION) /DEBIAN/control
2019-06-22 11:17:20 +00:00
mkdir -p out/docker-machine-driver-kvm2_$( DEB_VERSION) /usr/bin
2020-02-03 21:15:02 +00:00
cp $< out/docker-machine-driver-kvm2_$( DEB_VERSION) /usr/bin/docker-machine-driver-kvm2
2020-02-02 12:55:07 +00:00
fakeroot dpkg-deb --build out/docker-machine-driver-kvm2_$( DEB_VERSION) $@
2019-06-22 11:17:20 +00:00
rm -rf out/docker-machine-driver-kvm2_$( DEB_VERSION)
2021-06-25 03:02:21 +00:00
out/docker-machine-driver-kvm2-$(RPM_VERSION).rpm : out /docker -machine -driver -kvm 2-$( RPM_VERSION ) -0.x 86_ 64.rpm
cp $< $@
out/docker-machine-driver-kvm2_$(RPM_VERSION).amd64.rpm : out /docker -machine -driver -kvm 2-$( RPM_VERSION ) -0.x 86_ 64.rpm
cp $< $@
out/docker-machine-driver-kvm2_$(RPM_VERSION).arm64.rpm : out /docker -machine -driver -kvm 2-$( RPM_VERSION ) -0.aarch 64.rpm
2020-02-02 12:55:07 +00:00
cp $< $@
out/docker-machine-driver-kvm2-$(RPM_VERSION)-0.%.rpm : out /docker -machine -driver -kvm 2-%
2019-06-22 11:17:20 +00:00
cp -r installers/linux/rpm/kvm2_rpm_template out/docker-machine-driver-kvm2-$( RPM_VERSION)
2021-06-25 03:02:21 +00:00
sed -E -i -e 's/--VERSION--/' $( RPM_VERSION) '/g' out/docker-machine-driver-kvm2-$( RPM_VERSION) /docker-machine-driver-kvm2.spec
sed -E -i -e 's|--OUT--|' $( PWD) /out'|g' out/docker-machine-driver-kvm2-$( RPM_VERSION) /docker-machine-driver-kvm2.spec
2020-02-02 12:55:07 +00:00
rpmbuild -bb -D " _rpmdir $( PWD) /out " --target $* \
2019-06-22 11:17:20 +00:00
out/docker-machine-driver-kvm2-$( RPM_VERSION) /docker-machine-driver-kvm2.spec
2020-02-02 12:55:07 +00:00
@mv out/$* /docker-machine-driver-kvm2-$( RPM_VERSION) -0.$* .rpm out/ && rmdir out/$*
2019-06-22 11:17:20 +00:00
rm -rf out/docker-machine-driver-kvm2-$( RPM_VERSION)
2021-06-25 06:01:03 +00:00
.PHONY : kvm -image -amd 64
kvm-image-amd64 : installers /linux /kvm /Dockerfile .amd 64 ## Convenient alias to build the docker container
docker build --build-arg " GO_VERSION= $( KVM_GO_VERSION) " -t $( KVM_BUILD_IMAGE_AMD64) -f $< $( dir $<)
@echo ""
@echo " $( @) successfully built "
.PHONY : kvm -image -arm 64
kvm-image-arm64 : installers /linux /kvm /Dockerfile .arm 64 ## Convenient alias to build the docker container
2021-06-25 07:38:30 +00:00
docker build --build-arg " GO_VERSION= $( KVM_GO_VERSION) " -t $( KVM_BUILD_IMAGE_ARM64) -f $< $( dir $<)
2019-02-16 13:45:30 +00:00
@echo ""
@echo " $( @) successfully built "
kvm_in_docker :
2021-06-25 06:01:03 +00:00
docker image inspect -f '{{.Id}} {{.RepoTags}}' $( KVM_BUILD_IMAGE_AMD64) || $( MAKE) kvm-image-amd64
2019-02-16 13:45:30 +00:00
rm -f out/docker-machine-driver-kvm2
2021-06-25 06:01:03 +00:00
$( call DOCKER,$( KVM_BUILD_IMAGE_AMD64) ,/usr/bin/make out/docker-machine-driver-kvm2 COMMIT = $( COMMIT) )
2019-02-16 13:45:30 +00:00
2019-07-13 19:31:21 +00:00
.PHONY : install -kvm -driver
2019-10-13 19:23:34 +00:00
install-kvm-driver : out /docker -machine -driver -kvm 2 ## Install KVM Driver
2019-08-01 10:55:12 +00:00
mkdir -p $( GOBIN)
2017-08-28 18:27:25 +00:00
cp out/docker-machine-driver-kvm2 $( GOBIN) /docker-machine-driver-kvm2
2017-09-19 21:01:15 +00:00
2021-06-25 06:01:03 +00:00
2021-06-25 07:38:30 +00:00
out/docker-machine-driver-kvm2-arm64 :
i f e q ( $( MINIKUBE_BUILD_IN_DOCKER ) , y )
docker image inspect -f '{{.Id}} {{.RepoTags}}' $( KVM_BUILD_IMAGE_ARM64) || $( MAKE) kvm-image-arm64
$( call DOCKER,$( KVM_BUILD_IMAGE_ARM64) ,/usr/bin/make $@ COMMIT = $( COMMIT) )
e l s e
$( if $( quiet) ,@echo " GO $@ " )
$( Q) GOARCH = arm64 \
go build \
-installsuffix "static" \
-ldflags= " $( KVM2_LDFLAGS) " \
-tags "libvirt.1.3.1 without_lxc" \
-o $@ \
k8s.io/minikube/cmd/drivers/kvm
e n d i f
chmod +X $@
2021-06-25 06:01:03 +00:00
2021-06-25 03:02:21 +00:00
out/docker-machine-driver-kvm2-% :
i f e q ( $( MINIKUBE_BUILD_IN_DOCKER ) , y )
2021-06-25 06:01:03 +00:00
docker image inspect -f '{{.Id}} {{.RepoTags}}' $( KVM_BUILD_IMAGE_AMD64) || $( MAKE) kvm-image-amd64
$( call DOCKER,$( KVM_BUILD_IMAGE_AMD64) ,/usr/bin/make $@ COMMIT = $( COMMIT) )
2021-06-25 03:02:21 +00:00
# make extra sure that we are linking with the older version of libvirt (1.3.1)
test " `strings $@ | grep '^LIBVIRT_[0-9]' | sort | tail -n 1` " = "LIBVIRT_1.2.9"
e l s e
$( if $( quiet) ,@echo " GO $@ " )
$( Q) GOARCH = $* \
go build \
-installsuffix "static" \
-ldflags= " $( KVM2_LDFLAGS) " \
-tags "libvirt.1.3.1 without_lxc" \
-o $@ \
k8s.io/minikube/cmd/drivers/kvm
e n d i f
chmod +X $@
2019-08-13 23:54:08 +00:00
2020-03-26 10:00:56 +00:00
site/themes/docsy/assets/vendor/bootstrap/package.js : ## update the website docsy theme git submodule
2019-08-13 23:54:08 +00:00
git submodule update -f --init --recursive
out/hugo/hugo :
mkdir -p out
2019-08-14 14:30:00 +00:00
test -d out/hugo || git clone https://github.com/gohugoio/hugo.git out/hugo
2021-06-18 13:24:42 +00:00
( cd out/hugo && go build --tags extended)
2019-08-13 23:54:08 +00:00
.PHONY : site
2019-10-13 19:23:34 +00:00
site : site /themes /docsy /assets /vendor /bootstrap /package .js out /hugo /hugo ## Serve the documentation site to localhost
2019-08-13 23:54:08 +00:00
( cd site && ../out/hugo/hugo serve \
--disableFastRender \
--navigateToChanged \
--ignoreCache \
--buildFuture)
2019-10-18 23:55:58 +00:00
.PHONY : out /mkcmp
out/mkcmp :
2019-10-29 20:46:32 +00:00
GOOS = $( GOOS) GOARCH = $( GOARCH) go build -o $@ cmd/performance/mkcmp/main.go
2021-02-16 04:13:02 +00:00
2021-04-08 16:59:03 +00:00
# auto pause binary to be used for ISO
2021-06-17 17:57:00 +00:00
deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/usr/bin/auto-pause : $( SOURCE_FILES ) $( ASSET_FILES )
2021-04-08 02:36:48 +00:00
GOOS = linux GOARCH = $( GOARCH) go build -o $@ cmd/auto-pause/auto-pause.go
2021-03-23 07:03:42 +00:00
.PHONY : deploy /addons /auto -pause /auto -pause -hook
2021-06-17 17:57:00 +00:00
deploy/addons/auto-pause/auto-pause-hook : ## Build auto-pause hook addon
2021-03-15 05:56:44 +00:00
$( if $( quiet) ,@echo " GO $@ " )
$( Q) GOOS = linux CGO_ENABLED = 0 go build -a --ldflags '-extldflags "-static"' -tags netgo -installsuffix netgo -o $@ cmd/auto-pause/auto-pause-hook/main.go cmd/auto-pause/auto-pause-hook/config.go cmd/auto-pause/auto-pause-hook/certs.go
.PHONY : auto -pause -hook -image
2021-03-23 07:03:42 +00:00
auto-pause-hook-image : deploy /addons /auto -pause /auto -pause -hook ## Build docker image for auto-pause hook
2021-05-04 23:18:33 +00:00
docker build -t $( REGISTRY) /auto-pause-hook:$( AUTOPAUSE_HOOK_TAG) ./deploy/addons/auto-pause
2021-03-15 05:56:44 +00:00
.PHONY : push -auto -pause -hook -image
push-auto-pause-hook-image : auto -pause -hook -image
2021-05-04 23:18:33 +00:00
docker login gcr.io/k8s-minikube
$( MAKE) push-docker IMAGE = $( REGISTRY) /auto-pause-hook:$( AUTOPAUSE_HOOK_TAG)
2021-03-15 05:56:44 +00:00
2021-05-02 08:59:28 +00:00
.PHONY : prow -test -image
prow-test-image :
2021-05-04 22:53:54 +00:00
docker build --build-arg " GO_VERSION= $( GO_VERSION) " -t $( REGISTRY) /prow-test:$( PROW_TEST_TAG) ./deploy/prow
2021-05-02 08:59:28 +00:00
.PHONY : push -prow -test -image
push-prow-test-image : prow -test -image
2021-05-04 22:53:54 +00:00
docker login gcr.io/k8s-minikube
$( MAKE) push-docker IMAGE = $( REGISTRY) /prow-test:$( PROW_TEST_TAG)
2021-05-02 08:59:28 +00:00
2020-09-22 17:56:53 +00:00
.PHONY : out /performance -bot
out/performance-bot :
GOOS = $( GOOS) GOARCH = $( GOARCH) go build -o $@ cmd/performance/pr-bot/bot.go
2019-10-13 19:23:34 +00:00
2020-12-02 03:37:15 +00:00
.PHONY : out /metrics -collector
out/metrics-collector :
GOOS = $( GOOS) GOARCH = $( GOARCH) go build -o $@ hack/metrics/*.go
2019-10-21 20:11:30 +00:00
.PHONY : compare
compare : out /mkcmp out /minikube
mv out/minikube out/$( CURRENT_GIT_BRANCH) .minikube
git checkout master
make out/minikube
mv out/minikube out/master.minikube
git checkout $( CURRENT_GIT_BRANCH)
out/mkcmp out/master.minikube out/$( CURRENT_GIT_BRANCH) .minikube
2019-11-26 18:32:32 +00:00
2019-12-23 06:19:52 +00:00
2019-10-13 19:23:34 +00:00
.PHONY : help
help :
@printf " \033[1mAvailable targets for minikube ${ VERSION } \033[21m\n "
@printf "\033[1m--------------------------------------\033[21m\n"
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $( MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
2020-12-10 01:28:40 +00:00
2021-07-26 22:56:21 +00:00
.PHONY : update -golang -version
update-golang-version :
( cd hack/update/golang_version && \
go run update_golang_version.go)
2020-12-10 01:28:40 +00:00
.PHONY : update -kubernetes -version
update-kubernetes-version :
( cd hack/update/kubernetes_version && \
go run update_kubernetes_version.go)
2021-08-13 01:16:47 +00:00
.PHONY : update -golint -version
update-golint-version :
( cd hack/update/golint_version && \
go run update_golint_version.go)
2021-12-21 02:27:06 +00:00
.PHONY : update -preload -version
update-preload-version :
( cd hack/update/preload_version && \
go run update_preload_version.go)
2021-08-13 01:16:47 +00:00
2020-12-10 01:28:40 +00:00
.PHONY : update -kubernetes -version -pr
update-kubernetes-version-pr :
2020-12-10 02:16:29 +00:00
i f n d e f G I T H U B _ T O K E N
@echo "⚠️ please set GITHUB_TOKEN environment variable with your GitHub token"
2020-12-10 02:27:19 +00:00
@echo "you can use https://github.com/settings/tokens/new?scopes=repo,write:packages to create new one"
2020-12-10 02:16:29 +00:00
e l s e
2020-12-10 01:28:40 +00:00
( cd hack/update/kubernetes_version && \
2020-12-10 01:34:40 +00:00
export UPDATE_TARGET = "all" && \
2020-12-10 01:28:40 +00:00
go run update_kubernetes_version.go)
2020-12-10 02:16:29 +00:00
e n d i f
2021-01-12 21:55:22 +00:00
2021-07-31 17:50:32 +00:00
.PHONY : update -kubeadm -constants
update-kubeadm-constants :
( cd hack/update/kubeadm_constants && \
2021-08-01 08:12:42 +00:00
go run update_kubeadm_constants.go)
gofmt -w pkg/minikube/constants/constants_kubeadm_images.go
2021-07-31 17:50:32 +00:00
2021-01-19 21:19:06 +00:00
.PHONY : stress
2021-01-29 19:57:45 +00:00
stress : ## run the stress tests
2021-01-20 20:49:03 +00:00
go test -test.v -test.timeout= 2h ./test/stress -loops= 10 | tee " ./out/testout_ $( COMMIT_SHORT) .txt "
2021-01-20 20:52:53 +00:00
2021-04-24 18:44:16 +00:00
.PHONY : cpu -benchmark -idle
cpu-benchmark-idle : ## run the cpu usage 5 minutes idle benchmark
./hack/benchmark/cpu_usage/idle_only/benchmark_local_k8s.sh
.PHONY : cpu -benchmark -autopause
cpu-benchmark-autopause : ## run the cpu usage auto-pause benchmark
./hack/benchmark/cpu_usage/auto_pause/benchmark_local_k8s.sh
2021-04-15 14:21:03 +00:00
2021-05-26 22:45:11 +00:00
.PHONY : time -to -k 8s -benchmark
time-to-k8s-benchmark :
./hack/benchmark/time-to-k8s/time-to-k8s.sh
2021-01-19 23:50:10 +00:00
.PHONY : update -gopogh -version
2021-01-20 00:30:28 +00:00
update-gopogh-version : ## update gopogh version
2021-01-19 23:50:10 +00:00
( cd hack/update/gopogh_version && \
2021-08-13 01:17:09 +00:00
go run update_gopogh_version.go)