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
2020-09-02 23:16:51 +00:00
VERSION_MINOR ?= 13
2020-09-18 23:20:58 +00:00
VERSION_BUILD ?= 1
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
2020-09-18 23:20:58 +00:00
ISO_VERSION ?= v$( VERSION_MAJOR) .$( VERSION_MINOR) .1
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) )
RPM_VERSION ?= $( DEB_VERSION)
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
2020-07-20 21:45:26 +00:00
GO_VERSION ?= 1.14.6
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)
2020-07-05 20:17:11 +00:00
BUILDROOT_BRANCH ?= 2019.02.11
2017-02-08 19:10:12 +00:00
REGISTRY ?= gcr.io/k8s-minikube
2020-08-11 09:59:40 +00:00
REGISTRY_GH ?= docker.pkg.github.com/kubernetes/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 )
2019-05-09 18:46:14 +00:00
HYPERKIT_BUILD_IMAGE ?= karalabe/xgo-1.12.x
2020-06-28 18:32:44 +00:00
# NOTE: "latest" as of 2020-05-13. kube-cross images aren't updated as often as Kubernetes
2020-07-07 07:41:04 +00:00
# https://github.com/kubernetes/kubernetes/blob/master/build/build-image/cross/VERSION
2020-07-20 21:45:26 +00:00
BUILD_IMAGE ?= us.gcr.io/k8s-artifacts-prod/build-image/kube-cross:v$( GO_VERSION) -1
2017-03-22 18:00:17 +00:00
ISO_BUILD_IMAGE ?= $( REGISTRY) /buildroot-image
2019-07-30 19:32:41 +00:00
KVM_BUILD_IMAGE ?= $( REGISTRY) /kvm-build-image:$( GO_VERSION)
2019-02-16 13:45:30 +00:00
2020-08-11 09:59:40 +00:00
KIC_BASE_IMAGE_GCR ?= $( REGISTRY) /kicbase:$( KIC_VERSION)
KIC_BASE_IMAGE_GH ?= $( REGISTRY_GH) /kicbase:$( KIC_VERSION)
KIC_BASE_IMAGE_HUB ?= kicbase/stable:$( KIC_VERSION)
2020-07-23 12:24:38 +00:00
2017-02-10 22:43:54 +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
2020-07-05 20:08:44 +00:00
KERNEL_VERSION ?= 4.19.107
2019-08-15 20:46:25 +00:00
# latest from https://github.com/golangci/golangci-lint/releases
2020-08-31 00:20:42 +00:00
GOLINT_VERSION ?= v1.30.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 } " \
2019-10-24 20:28:18 +00:00
--enable goimports,gocritic,golint,gocyclo,misspell,nakedret,stylecheck,unconvert,unparam,dogsled \
2019-12-18 21:37:12 +00:00
--exclude 'variable on range scope.*in function literal|ifElseChain' \
--skip-files "pkg/minikube/translate/translations.go|pkg/minikube/assets/assets.go"
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)
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
# storage provisioner tag to push changes to
2020-09-01 23:15:21 +00:00
STORAGE_PROVISIONER_TAG ?= v3
2020-02-06 14:43:12 +00:00
2020-01-09 19:25:01 +00:00
# TODO: multi-arch manifest
i f e q ( $( GOARCH ) , a m d 6 4 )
STORAGE_PROVISIONER_IMAGE ?= $( REGISTRY) /storage-provisioner:$( STORAGE_PROVISIONER_TAG)
e l s e
STORAGE_PROVISIONER_IMAGE ?= $( REGISTRY) /storage-provisioner-$( GOARCH) :$( STORAGE_PROVISIONER_TAG)
e n d i f
2016-11-29 19:55:49 +00:00
2018-06-19 21:07:37 +00:00
# Set the version information for the Kubernetes servers
2020-08-03 17:48:09 +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.isoPath= $( ISO_BUCKET) -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
2017-09-06 23:22:49 +00:00
MINIKUBE_BUILD_TAGS := container_image_ostree_stub containers_image_openpgp
2019-09-10 18:05:29 +00:00
MINIKUBE_BUILD_TAGS += go_getter_nos3 go_getter_nogcs
2017-09-06 23:22:49 +00:00
MINIKUBE_INTEGRATION_BUILD_TAGS := integration $( MINIKUBE_BUILD_TAGS)
2019-05-20 20:30:40 +00:00
CMD_SOURCE_DIRS = cmd pkg
2019-06-22 12:34:18 +00:00
SOURCE_DIRS = $( CMD_SOURCE_DIRS) test
2019-03-23 11:51:13 +00:00
SOURCE_PACKAGES = ./cmd/... ./pkg/... ./test/...
2017-09-06 23:22:49 +00:00
2019-10-27 07:45:10 +00:00
SOURCE_GENERATED = pkg/minikube/assets/assets.go pkg/minikube/translate/translations.go
SOURCE_FILES = $( shell find $( CMD_SOURCE_DIRS) -type f -name "*.go" | grep -v _test.go)
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
2019-11-02 08:04:07 +00:00
out/minikube$(IS_EXE) : $( SOURCE_GENERATED ) $( SOURCE_FILES ) go .mod
2019-11-02 08:20:54 +00:00
i f e q ( $( MINIKUBE_BUILD_IN_DOCKER ) , y )
$( call DOCKER,$( BUILD_IMAGE) ,GOOS= $( GOOS) GOARCH = $( GOARCH) /usr/bin/make $@ )
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
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
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
2019-10-19 15:54:33 +00:00
.PHONY : minikube -linux -amd 64 minikube -linux -arm 64 minikube -darwin -amd 64 minikube -windows -amd 64.exe
2019-10-13 19:23:34 +00:00
minikube-linux-amd64 : out /minikube -linux -amd 64 ## Build Minikube for Linux 64bit
minikube-linux-arm64 : out /minikube -linux -arm 64 ## Build Minikube for ARM 64bit
minikube-darwin-amd64 : out /minikube -darwin -amd 64 ## Build Minikube for Darwin 64bit
minikube-windows-amd64.exe : out /minikube -windows -amd 64.exe ## Build Minikube for Windows 64bit
2017-06-28 20:47:54 +00:00
2019-10-27 07:45:10 +00:00
out/minikube-% : $( SOURCE_GENERATED ) $( SOURCE_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 $@ " )
$( Q) GOOS = " $( firstword $( subst -, ,$* ) ) " GOARCH = " $( lastword $( subst -, ,$( subst $( IS_EXE) , ,$* ) ) ) " \
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
2019-07-31 12:09:47 +00:00
.PHONY : e 2e -linux -amd 64 e 2e -darwin -amd 64 e 2e -windows -amd 64.exe
2019-10-13 19:23:34 +00:00
e2e-linux-amd64 : out /e 2e -linux -amd 64 ## Execute end-to-end testing for Linux 64bit
e2e-darwin-amd64 : out /e 2e -darwin -amd 64 ## Execute end-to-end testing for Darwin 64bit
e2e-windows-amd64.exe : out /e 2e -windows -amd 64.exe ## Execute end-to-end testing 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
2017-03-22 18:00:17 +00:00
minikube_iso : # old target kept for making tests happy
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; \
2016-11-03 21:22:44 +00:00
fi ;
$( MAKE) BR2_EXTERNAL = ../../deploy/iso/minikube-iso minikube_defconfig -C $( BUILD_DIR) /buildroot
2020-05-17 19:50:06 +00:00
mkdir -p $( BUILD_DIR) /buildroot/output/build
echo "module buildroot.org/go" > $( BUILD_DIR) /buildroot/output/build/go.mod
2016-11-03 21:22:44 +00:00
$( MAKE) -C $( BUILD_DIR) /buildroot
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
2018-06-08 22:01:16 +00:00
$( MAKE) -C $( BUILD_DIR) /buildroot menuconfig
$( MAKE) -C $( BUILD_DIR) /buildroot savedefconfig
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 \
$( ISO_BUILD_IMAGE) /usr/bin/make out/minikube.iso
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
2019-06-24 22:15:01 +00:00
test-iso : pkg /minikube /assets /assets .go pkg /minikube /translate /translations .go
2019-09-11 20:07:34 +00:00
go test -v ./test/integration --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
2019-10-13 19:23:34 +00:00
test-pkg/% : pkg /minikube /assets /assets .go pkg /minikube /translate /translations .go ## 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
2020-05-04 05:18:25 +00:00
all : cross drivers e 2e -cross cross -tars exotic out /gvisor -addon ## Build all different minikube components
2017-10-05 18:55:35 +00:00
.PHONY : drivers
2019-10-13 19:23:34 +00:00
drivers : docker -machine -driver -hyperkit docker -machine -driver -kvm 2 ## Build Hyperkit and KVM2 drivers
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-09-10 22:55:08 +00:00
go test -ldflags= " ${ MINIKUBE_LDFLAGS } " -v -test.timeout= 90m ./test/integration --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-09-10 22:55:08 +00:00
go test -ldflags= " ${ MINIKUBE_LDFLAGS } " -v -test.timeout= 90m ./test/integration --tags= " $( MINIKUBE_INTEGRATION_BUILD_TAGS) versioned " $( TEST_ARGS) 2>& 1 | tee " ./out/testout_ $( COMMIT_SHORT) .txt "
.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-09-10 23:04:17 +00:00
go test -ldflags= " ${ MINIKUBE_LDFLAGS } " -v -test.timeout= 20m ./test/integration --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
2019-10-13 19:23:34 +00:00
test : pkg /minikube /assets /assets .go pkg /minikube /translate /translations .go ## 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
2020-04-03 02:06:50 +00:00
generate-docs : out /minikube ## Automatically generate commands documentation.
2020-04-07 22:15:08 +00:00
out/minikube generate-docs --path ./site/content/en/docs/commands/
2020-04-01 23:15:27 +00:00
2020-04-15 17:51:25 +00:00
.PHONY : gotest
gotest : $( SOURCE_GENERATED ) ## 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
2020-04-01 23:15:27 +00:00
.PHONY : extract
extract : ## Compile extract tool
go run cmd/extract/extract.go
2020-01-19 21:29:30 +00:00
2019-05-07 18:17:30 +00:00
# Regenerates assets.go when template files have been updated
2019-09-03 23:45:58 +00:00
pkg/minikube/assets/assets.go : $( shell find "deploy /addons " -type f )
2019-07-29 10:44:30 +00:00
i f e q ( $( MINIKUBE_BUILD_IN_DOCKER ) , y )
$( call DOCKER,$( BUILD_IMAGE) ,/usr/bin/make $@ )
e n d i f
2020-09-27 15:35:49 +00:00
@which go-bindata >/dev/null 2>& 1 || GO111MODULE = off GOBIN = " $( GOPATH) $( DIRSEP) bin " go get github.com/go-bindata/go-bindata/...
2020-08-30 16:12:21 +00:00
$( if $( quiet) ,@echo " GEN $@ " )
$( Q) PATH = " $( PATH) $( PATHSEP) $( GOPATH) $( DIRSEP) bin " go-bindata -nomemcopy -o $@ -pkg assets deploy/addons/...
$( Q) -gofmt -s -w $@
2019-10-19 07:35:43 +00:00
@#golint: Dns should be DNS ( compat sed)
@sed -i -e 's/Dns/DNS/g' $@ && rm -f ./-e
2019-11-02 08:40:12 +00:00
@#golint: Html should be HTML ( compat sed)
@sed -i -e 's/Html/HTML/g' $@ && rm -f ./-e
2016-07-04 10:10:44 +00:00
2019-09-03 23:45:58 +00:00
pkg/minikube/translate/translations.go : $( shell find "translations /" -type f )
2019-07-29 10:44:30 +00:00
i f e q ( $( MINIKUBE_BUILD_IN_DOCKER ) , y )
$( call DOCKER,$( BUILD_IMAGE) ,/usr/bin/make $@ )
e n d i f
2020-09-27 15:35:49 +00:00
@which go-bindata >/dev/null 2>& 1 || GO111MODULE = off GOBIN = " $( GOPATH) $( DIRSEP) bin " go get github.com/go-bindata/go-bindata/...
2020-08-30 16:12:21 +00:00
$( if $( quiet) ,@echo " GEN $@ " )
$( Q) PATH = " $( PATH) $( PATHSEP) $( GOPATH) $( DIRSEP) bin " go-bindata -nomemcopy -o $@ -pkg translate translations/...
$( Q) -gofmt -s -w $@
2019-07-04 20:50:49 +00:00
@#golint: Json should be JSON ( compat sed)
@sed -i -e 's/Json/JSON/' $@ && rm -f ./-e
2019-06-24 22:15:01 +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
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
2019-10-13 19:23:34 +00:00
e2e-cross : e 2e -linux -amd 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 \
2019-03-24 15:31:53 +00:00
out/docker-machine-driver-kvm2 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
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)
2019-06-22 12:34:18 +00:00
.PHONY : golint
2019-10-13 19:23:34 +00:00
golint : pkg /minikube /assets /assets .go pkg /minikube /translate /translations .go ## 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 )
lint : pkg /minikube /assets /assets .go pkg /minikube /translate /translations .go
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
2019-10-13 19:23:34 +00:00
lint : pkg /minikube /assets /assets .go pkg /minikube /translate /translations .go 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
2019-10-13 19:23:34 +00:00
lint-ci : pkg /minikube /assets /assets .go pkg /minikube /translate /translations .go 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
2019-09-03 23:45:58 +00:00
out/docs/minikube.md : $( shell find "cmd ") $( shell find "pkg /minikube /constants ") pkg /minikube /assets /assets .go pkg /minikube /translate /translations .go
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
2020-02-02 12:37:47 +00:00
deb_version :
@echo $( DEB_VERSION)
2019-10-19 15:54:33 +00:00
out/minikube_$(DEB_VERSION).deb : out /minikube_ $( DEB_VERSION ) -0_amd 64.deb
cp $< $@
out/minikube_$(DEB_VERSION)-0_%.deb : out /minikube -linux -%
2016-08-12 22:46:22 +00:00
cp -r installers/linux/deb/minikube_deb_template out/minikube_$( DEB_VERSION)
chmod 0755 out/minikube_$( DEB_VERSION) /DEBIAN
sed -E -i 's/--VERSION--/' $( DEB_VERSION) '/g' out/minikube_$( DEB_VERSION) /DEBIAN/control
2019-10-19 15:54:33 +00:00
sed -E -i 's/--ARCH--/' $* '/g' out/minikube_$( DEB_VERSION) /DEBIAN/control
2016-10-05 17:29:27 +00:00
mkdir -p out/minikube_$( DEB_VERSION) /usr/bin
2019-10-19 15:54:33 +00:00
cp $< out/minikube_$( DEB_VERSION) /usr/bin/minikube
fakeroot dpkg-deb --build out/minikube_$( DEB_VERSION) $@
2016-08-12 22:46:22 +00:00
rm -rf out/minikube_$( DEB_VERSION)
2016-09-07 23:44:01 +00:00
2020-02-02 12:37:47 +00:00
rpm_version :
@echo $( RPM_VERSION)
2019-10-19 15:54:33 +00:00
out/minikube-$(RPM_VERSION).rpm : out /minikube -$( RPM_VERSION ) -0.x 86_ 64.rpm
cp $< $@
out/minikube-$(RPM_VERSION)-0.%.rpm : out /minikube -linux -%
2019-02-24 14:46:43 +00:00
cp -r installers/linux/rpm/minikube_rpm_template out/minikube-$( RPM_VERSION)
sed -E -i 's/--VERSION--/' $( RPM_VERSION) '/g' out/minikube-$( RPM_VERSION) /minikube.spec
sed -E -i 's|--OUT--|' $( PWD) /out'|g' out/minikube-$( RPM_VERSION) /minikube.spec
2019-10-19 15:54:33 +00:00
rpmbuild -bb -D " _rpmdir $( PWD) /out " --target $* \
2019-02-24 14:46:43 +00:00
out/minikube-$( RPM_VERSION) /minikube.spec
2019-10-19 15:54:33 +00:00
@mv out/$* /minikube-$( RPM_VERSION) -0.$* .rpm out/ && rmdir out/$*
2019-02-24 14:46:43 +00:00
rm -rf out/minikube-$( RPM_VERSION)
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
TAR_TARGETS_darwin-amd64 := out/minikube-darwin-amd64 out/docker-machine-driver-hyperkit
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
2019-10-13 19:23:34 +00:00
check-release : ## Execute go test
2016-09-23 19:00:23 +00:00
go test -v ./deploy/minikube/release_sanity_test.go -tags= release
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
storage-provisioner-image : out /storage -provisioner -$( GOARCH ) ## Build storage-provisioner docker image
docker build -t $( STORAGE_PROVISIONER_IMAGE) -f deploy/storage-provisioner/Dockerfile --build-arg arch = $( GOARCH) .
2020-01-08 21:52:07 +00:00
.PHONY : kic -base -image
kic-base-image : ## builds the base image used for kic.
2020-08-11 09:59:40 +00:00
docker rmi -f $( KIC_BASE_IMAGE_GCR) -snapshot || true
2020-09-29 18:13:05 +00:00
docker build -f ./deploy/kicbase/Dockerfile -t local/kicbase:$( KIC_VERSION) -snapshot --build-arg COMMIT_SHA = ${ VERSION } -$( COMMIT) --cache-from $( KIC_BASE_IMAGE_GCR) ./deploy/kicbase
2020-08-11 09:59:40 +00:00
docker tag local/kicbase:$( KIC_VERSION) -snapshot $( KIC_BASE_IMAGE_GCR) -snapshot
docker tag local/kicbase:$( KIC_VERSION) -snapshot $( KIC_BASE_IMAGE_GCR)
docker tag local/kicbase:$( KIC_VERSION) -snapshot $( KIC_BASE_IMAGE_HUB)
docker tag local/kicbase:$( KIC_VERSION) -snapshot $( KIC_BASE_IMAGE_GH)
2020-02-07 19:15:34 +00:00
2020-02-20 19:55:47 +00:00
.PHONY : upload -preloaded -images -tar
2020-03-13 23:05:46 +00:00
upload-preloaded-images-tar : out /minikube # Upload the preloaded images for oldest supported, newest supported, and default kubernetes versions to GCS.
2020-08-03 23:09:45 +00:00
go build -ldflags= " $( MINIKUBE_LDFLAGS) " -o out/upload-preload ./hack/preload-images/*.go
./out/upload-preload
2020-01-08 21:52:07 +00:00
2017-11-06 18:12:10 +00:00
.PHONY : push -storage -provisioner -image
2019-10-13 19:23:34 +00:00
push-storage-provisioner-image : storage -provisioner -image ## Push storage-provisioner docker image using gcloud
2020-08-14 10:24:42 +00:00
docker login gcr.io/k8s-minikube
$( MAKE) push-docker IMAGE = $( STORAGE_PROVISIONER_IMAGE)
2017-10-30 20:07:48 +00:00
2020-08-11 09:59:40 +00:00
.PHONY : push -docker
push-docker : # Push docker image base on to IMAGE variable
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
.PHONY : push -kic -base -image -gcr
push-kic-base-image-gcr : kic -base -image ## Push kic-base to gcr
2020-08-12 00:06:26 +00:00
docker login gcr.io/k8s-minikube
2020-08-11 09:59:40 +00:00
$( MAKE) push-docker IMAGE = $( KIC_BASE_IMAGE_GCR)
.PHONY : push -kic -base -image -gh
push-kic-base-image-gh : kic -base -image ## Push kic-base to github
2020-08-12 00:06:26 +00:00
docker login docker.pkg.github.com
2020-08-11 09:59:40 +00:00
$( MAKE) push-docker IMAGE = $( KIC_BASE_IMAGE_GH)
.PHONY : push -kic -base -image -hub
push-kic-base-image-hub : kic -base -image ## Push kic-base to docker hub
2020-08-12 00:06:26 +00:00
docker login
2020-08-11 09:59:40 +00:00
$( MAKE) push-docker IMAGE = $( KIC_BASE_IMAGE_HUB)
2020-07-23 12:24:38 +00:00
.PHONY : push -kic -base -image
2020-08-11 09:59:40 +00:00
push-kic-base-image : ## Push kic-base to all registries
i f n d e f A U T O P U S H
$( call user_confirm, 'Are you sure you want to push: $(KIC_BASE_IMAGE_GH) & $(KIC_BASE_IMAGE_GCR) & $(KIC_BASE_IMAGE_HUB) ?' )
$( MAKE) push-kic-base-image AUTOPUSH = true
e l s e
$( MAKE) push-kic-base-image-gh push-kic-base-image-gcr push-kic-base-image-hub
e n d i f
2020-07-23 12:24:38 +00:00
2018-12-07 23:27:22 +00:00
.PHONY : out /gvisor -addon
2019-10-13 19:23:34 +00:00
out/gvisor-addon : pkg /minikube /assets /assets .go pkg /minikube /translate /translations .go ## 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
2020-02-02 12:55:07 +00:00
out/docker-machine-driver-kvm2 : out /docker -machine -driver -kvm 2-amd 64
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
2020-02-02 12:55:07 +00:00
out/docker-machine-driver-kvm2-% :
2019-07-13 19:31:21 +00:00
i f e q ( $( MINIKUBE_BUILD_IN_DOCKER ) , y )
2020-05-21 08:23:11 +00:00
docker image inspect -f '{{.Id}} {{.RepoTags}}' $( KVM_BUILD_IMAGE) || $( MAKE) kvm-image
2019-07-13 19:31:21 +00:00
$( call DOCKER,$( KVM_BUILD_IMAGE) ,/usr/bin/make $@ COMMIT = $( COMMIT) )
2019-07-13 19:35:04 +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"
2019-07-13 19:31:21 +00:00
e l s e
2020-08-30 16:12:21 +00:00
$( if $( quiet) ,@echo " GO $@ " )
$( Q) GOARCH = $* \
2019-08-12 21:42:11 +00:00
go build \
-installsuffix "static" \
-ldflags= " $( KVM2_LDFLAGS) " \
-tags "libvirt.1.3.1 without_lxc" \
2019-07-31 12:13:37 +00:00
-o $@ \
2017-08-22 22:31:54 +00:00
k8s.io/minikube/cmd/drivers/kvm
2019-07-13 19:31:21 +00:00
e n d i f
2017-08-22 22:31:54 +00:00
chmod +X $@
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 $< $@
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
sed -E -i 's/--VERSION--/' $( DEB_VERSION) '/g' out/docker-machine-driver-kvm2_$( DEB_VERSION) /DEBIAN/control
2020-02-02 12:55:07 +00:00
sed -E -i '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)
2020-02-02 12:55:07 +00:00
out/docker-machine-driver-kvm2-$(RPM_VERSION).rpm : out /docker -machine -driver -kvm 2-$( RPM_VERSION ) -0.x 86_ 64.deb
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)
sed -E -i 's/--VERSION--/' $( RPM_VERSION) '/g' out/docker-machine-driver-kvm2-$( RPM_VERSION) /docker-machine-driver-kvm2.spec
sed -E -i '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)
2019-10-13 19:23:34 +00:00
.PHONY : kvm -image
kvm-image : installers /linux /kvm /Dockerfile ## Convenient alias to build the docker container
2019-07-30 19:32:41 +00:00
docker build --build-arg " GO_VERSION= $( GO_VERSION) " -t $( KVM_BUILD_IMAGE) -f $< $( dir $<)
2019-02-16 13:45:30 +00:00
@echo ""
@echo " $( @) successfully built "
kvm_in_docker :
2020-05-21 08:23:11 +00:00
docker image inspect -f '{{.Id}} {{.RepoTags}}' $( KVM_BUILD_IMAGE) || $( MAKE) kvm-image
2019-02-16 13:45:30 +00:00
rm -f out/docker-machine-driver-kvm2
2019-07-02 17:51:06 +00:00
$( call DOCKER,$( KVM_BUILD_IMAGE) ,/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
.PHONY : release -kvm -driver
2019-10-13 19:23:34 +00:00
release-kvm-driver : install -kvm -driver checksum ## Release KVM Driver
2017-09-19 21:01:15 +00:00
gsutil cp $( GOBIN) /docker-machine-driver-kvm2 gs://minikube/drivers/kvm/$( VERSION) /
2019-03-24 15:31:53 +00:00
gsutil cp $( GOBIN) /docker-machine-driver-kvm2.sha256 gs://minikube/drivers/kvm/$( VERSION) /
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
( 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
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
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}'