github.com/zppinho/prow@v0.0.0-20240510014325-1738badeb017/Makefile (about) 1 # Copyright 2021 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 ################################################################################ 16 # ========================== Capture Environment =============================== 17 # get the repo root and output path 18 REPO_ROOT:=${CURDIR} 19 OUT_DIR=$(REPO_ROOT)/_output 20 # image building and publishing config 21 REGISTRY ?= gcr.io/k8s-prow 22 PROW_IMAGE ?= 23 ################################################################################ 24 # ================================= Testing ==================================== 25 # unit tests (hermetic) 26 unit: go-unit 27 .PHONY: unit 28 go-unit: 29 hack/make-rules/go-test/unit.sh 30 .PHONY: go-unit 31 # integration tests 32 # integration: 33 # hack/make-rules/go-test/integration.sh 34 # all tests 35 test: unit 36 .PHONY: test 37 ################################################################################ 38 # ================================= Cleanup ==================================== 39 # standard cleanup target 40 clean: 41 rm -rf "$(OUT_DIR)/" 42 ################################################################################ 43 # ============================== Auto-Update =================================== 44 # update generated code, gofmt, etc. 45 # update: 46 # hack/make-rules/update/all.sh 47 # update generated code 48 #generate: 49 # hack/make-rules/update/generated.sh 50 # gofmt 51 #gofmt: 52 # hack/make-rules/update/gofmt.sh 53 .PHONY: update-go-deps 54 update-go-deps: 55 hack/make-rules/update/go-deps.sh 56 .PHONY: verify-go-deps 57 verify-go-deps: 58 hack/make-rules/verify/go-deps.sh 59 ################################################################################ 60 # ================================== Dependencies =================================== 61 # python deps 62 ensure-py-requirements3: 63 hack/run-in-python-container.sh pip3 install -r requirements3.txt 64 .PHONY: ensure-py-requirements3 65 ################################################################################ 66 # ================================== Linting =================================== 67 # run linters, ensure generated code, etc. 68 .PHONY: verify 69 verify: 70 hack/make-rules/verify/all.sh 71 # go linters 72 .PHONY: go-lint 73 go-lint: 74 hack/make-rules/verify/golangci-lint.sh 75 .PHONY: update-gofmt 76 update-gofmt: 77 hack/make-rules/update/gofmt.sh 78 .PHONY: verify-gofmt 79 verify-gofmt: 80 hack/make-rules/verify/gofmt.sh 81 .PHONY: update-file-perms 82 update-file-perms: 83 hack/make-rules/update/file-perms.sh 84 .PHONY: verify-file-perms 85 verify-file-perms: 86 hack/make-rules/verify/file-perms.sh 87 .PHONY: update-spelling 88 update-spelling: 89 hack/make-rules/update/misspell.sh 90 .PHONY: verify-spelling 91 verify-spelling: 92 hack/make-rules/verify/misspell.sh 93 .PHONY: update-codegen 94 update-codegen: 95 hack/make-rules/update/codegen.sh 96 .PHONY: verify-codegen 97 verify-codegen: 98 hack/make-rules/verify/codegen.sh 99 .PHONY: verify-boilerplate 100 verify-boilerplate: ensure-py-requirements3 101 hack/make-rules/verify/boilerplate.sh 102 ################################################################################# 103 # Build and push specific variables. 104 REGISTRY ?= gcr.io/k8s-prow 105 PROW_IMAGE ?= 106 107 .PHONY: push-images 108 push-images: 109 hack/make-rules/go-run/arbitrary.sh run ./hack/prowimagebuilder --ko-docker-repo="${REGISTRY}" --push=true 110 111 .PHONY: build-images 112 build-images: 113 hack/make-rules/go-run/arbitrary.sh run ./hack/prowimagebuilder --ko-docker-repo="ko.local" --push=false 114 115 .PHONY: push-single-image 116 push-single-image: 117 hack/make-rules/go-run/arbitrary.sh run ./hack/prowimagebuilder --ko-docker-repo="${REGISTRY}" --push=true --image=${PROW_IMAGE} 118 119 .PHONY: build-single-image 120 build-single-image: 121 hack/make-rules/go-run/arbitrary.sh run ./hack/prowimagebuilder --ko-docker-repo="ko.local" --push=false --image=${PROW_IMAGE} 122 123 .PHONY: build-tarball 124 build-tarball: 125 # use --ko-docker-repo="something.not.exist" as ko skips writing `.tar` file if 126 # it's `ko.local. 127 hack/make-rules/go-run/arbitrary.sh run ./hack/prowimagebuilder --ko-docker-repo="something.not.exist" --push=false --image=${PROW_IMAGE}