github.com/munnerz/test-infra@v0.0.0-20190108210205-ce3d181dc989/images/kubekins-e2e/Makefile (about) 1 # Copyright 2016 The Kubernetes Authors. 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 IMG = gcr.io/k8s-testimages/kubekins-e2e 16 TAG := $(shell date +v%Y%m%d)-$(shell git describe --tags --always --dirty) 17 18 # kubernetes master branch config 19 K8S ?= master 20 GO ?= 1.11.4 21 BAZEL ?= 0.18.1 22 UPGRADE_DOCKER ?=false 23 # TODO(bentheelder,cblecker): this is aging and bad 24 CFSSL ?= R1.2 25 26 # config for testing prior to rolling out to master / ongoing release 27 ifeq ($(K8S), experimental) 28 GO = 1.11.4 29 BAZEL = 0.20.0 30 CFSSL = R1.2 31 UPGRADE_DOCKER = true 32 endif 33 34 # kubernetes release-X branch configs 35 ifeq ($(K8S), 1.13) 36 GO = 1.11.4 37 BAZEL = 0.18.1 38 CFSSL = R1.2 39 endif 40 41 ifeq ($(K8S), 1.12) 42 GO = 1.10.7 43 BAZEL = 0.18.1 44 CFSSL = R1.2 45 endif 46 47 ifeq ($(K8S), 1.11) 48 GO = 1.10.7 49 BAZEL = 0.14.0 50 CFSSL = R1.2 51 endif 52 53 ifeq ($(K8S), 1.10) 54 GO = 1.9.3 55 BAZEL = 0.14.0 56 CFSSL = R1.2 57 endif 58 59 60 all: build 61 62 kubetest: 63 CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o kubetest ../../kubetest 64 65 build: kubetest 66 @echo Building with go:$(GO) and bazel:$(BAZEL) 67 docker build --build-arg GO_VERSION=$(GO) --build-arg BAZEL_VERSION_ARG=$(BAZEL) --build-arg CFSSL_VERSION=$(CFSSL) --build-arg IMAGE_ARG=$(IMG):$(TAG)-$(K8S) --build-arg=UPGRADE_DOCKER_ARG=$(UPGRADE_DOCKER) -t $(IMG):$(TAG)-$(K8S) . 68 docker tag $(IMG):$(TAG)-$(K8S) $(IMG):latest-$(K8S) 69 rm kubetest 70 @echo Built $(IMG):$(TAG)-$(K8S) and tagged with latest-$(K8S) 71 72 push: build 73 docker push $(IMG):$(TAG)-$(K8S) 74 docker push $(IMG):latest-$(K8S) 75 @echo Pushed $(IMG) with :latest-$(K8S) and :$(TAG)-$(K8S) tags 76 77 .PHONY: all kubetest build push help 78 79 help: 80 @echo "By default, build a master image" 81 @echo "But you can also specify a k8s version, i.e. :" 82 @echo " - K8S=1.8 make build"