github.com/shashidharatd/test-infra@v0.0.0-20171006011030-71304e1ca560/kettle/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/kettle 16 TAG = $(shell date +v%Y%m%d)-$(shell git describe --tags --always --dirty) 17 18 # These are the usual GKE variables. 19 PROJECT ?= k8s-gubernator 20 ZONE ?= us-west1-b 21 CLUSTER ?= g8r 22 23 get-cluster-credentials: 24 kubectl config use-context gke_k8s-gubernator_us-west1-b_g8r || gcloud container clusters get-credentials "$(CLUSTER)" --project="$(PROJECT)" --zone="$(ZONE)" 25 26 build: 27 cp ../buckets.yaml . 28 docker build -t $(IMG):$(TAG) . 29 rm buckets.yaml 30 docker tag $(IMG):$(TAG) $(IMG):latest 31 echo Built $(IMG):$(TAG) and tagged with $(IMG):latest ; 32 33 push: build 34 gcloud docker -- push $(IMG):$(TAG) 35 gcloud docker -- push $(IMG):latest 36 echo Pushed $(IMG):latest and $(IMG):$(TAG) 37 38 deploy: get-cluster-credentials 39 sed "s/:latest/:$(TAG)/g" deployment.yaml | kubectl apply -f - 40 41 .PHONY: all build push 42 43 all: build