k8s.io/test-infra@v0.0.0-20240520184403-27c6b4c223d8/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 include ../Makefile.base.mk 16 # Makefile.base.mk requires REPO_ROOT to be set 17 REPO_ROOT:=${CURDIR}/.. 18 19 IMG = gcr.io/k8s-testimages/kettle 20 TAG := $(shell date +v%Y%m%d)-$(shell git describe --tags --always --dirty) 21 22 # These are the usual GKE variables. 23 PROJECT ?= kubernetes-public 24 ZONE ?= us-central1 25 CLUSTER ?= aaa 26 27 get-cluster-credentials: 28 kubectl config use-context gke_kubernetes-public_us-central1_aaa || gcloud container clusters get-credentials "$(CLUSTER)" --project="$(PROJECT)" --zone="$(ZONE)" 29 30 push-prod: 31 ../hack/make-rules/go-run/arbitrary.sh run ./images/builder --project=k8s-staging-infra-tools --scratch-bucket=gs://k8s-testimages-scratch --build-dir=. kettle/ 32 33 push: 34 ../hack/make-rules/go-run/arbitrary.sh run ./images/builder --project=k8s-staging-infra-tools --allow-dirty --build-dir=. kettle/ 35 36 deploy: get-cluster-credentials 37 sed "s/:latest/:$(TAG)/g" deployment.yaml | kubectl apply -f - --record 38 39 update: get-cluster-credentials 40 kubectl set image deployment/kettle kettle=$(IMG):$(TAG) --record 41 42 deploy-staging: get-cluster-credentials 43 sed "s/:latest/:$(TAG)/g" deployment-staging.yaml | kubectl apply -f - --record 44 45 update-staging: get-cluster-credentials 46 kubectl set image deployment/kettle-staging kettle-staging=$(IMG):$(TAG) --record 47 48 rollback: get-cluster-credentials 49 kubectl rollout undo deployments/kettle 50 51 test-make-db: ensure-py-requirements3 52 ../hack/run-in-python-container.sh ./kettle/make_db_test.py 53 54 test-model: ensure-py-requirements3 55 ../hack/run-in-python-container.sh ./kettle/model_test.py 56 57 test-stream: ensure-py-requirements3 58 ../hack/run-in-python-container.sh ./kettle/stream_test.py 59 60 test-make-json: ensure-py-requirements3 61 ../hack/run-in-python-container.sh ./kettle/make_json_test.py 62 63 test: test-make-db test-model test-stream test-make-json 64 65 .PHONY: all push test-make-db