github.com/abayer/test-infra@v0.0.5/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.10.2
    21  BAZEL ?= 0.14.0
    22  CFSSL ?= R1.2
    23  
    24  # config for testing prior to rolling out to master / ongoing release
    25  ifeq ($(K8S), experimental)
    26  	GO = 1.10.2
    27  	BAZEL = 0.14.0
    28  	CFSSL = R1.2
    29  endif
    30  
    31  # kubernetes release-X branch configs
    32  ifeq ($(K8S), 1.11)
    33  	GO = 1.10.2
    34  	BAZEL = 0.14.0
    35  	CFSSL = R1.2
    36  endif
    37  
    38  ifeq ($(K8S), 1.10)
    39  	GO = 1.9.3
    40  	BAZEL = 0.14.0
    41  	CFSSL = R1.2
    42  endif
    43  
    44  ifeq ($(K8S), 1.9)
    45  	GO = 1.9.2
    46  	BAZEL = 0.8.1
    47  	CFSSL = R1.2
    48  endif
    49  
    50  # TODO(bentheelder,krzyzacy) deprecate once 1.11 is out
    51  ifeq ($(K8S), 1.8)
    52  	GO = 1.8.3
    53  	BAZEL = 0.6.1
    54  	CFSSL = R1.2
    55  endif
    56  
    57  
    58  all: build
    59  
    60  kubetest:
    61  	CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o kubetest ../../kubetest
    62  
    63  build: kubetest
    64  	@echo Building with go:$(GO) and bazel:$(BAZEL)
    65  	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) -t $(IMG):$(TAG)-$(K8S) .
    66  	docker tag $(IMG):$(TAG)-$(K8S) $(IMG):latest-$(K8S)
    67  	rm kubetest
    68  	@echo Built $(IMG):$(TAG)-$(K8S) and tagged with latest-$(K8S)
    69  
    70  push: build
    71  	docker push $(IMG):$(TAG)-$(K8S)
    72  	docker push $(IMG):latest-$(K8S)
    73  	@echo Pushed $(IMG) with :latest-$(K8S) and :$(TAG)-$(K8S) tags
    74  
    75  .PHONY: all kubetest build push help
    76  
    77  help:
    78  	@echo "By default, build a master image"
    79  	@echo "But you can also specify a k8s version, i.e. :"
    80  	@echo "    - K8S=1.8 make build"