forked from kubernetes-sigs/prow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
142 lines (137 loc) · 5.21 KB
/
Makefile
File metadata and controls
142 lines (137 loc) · 5.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# Copyright 2021 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################
# ========================== Capture Environment ===============================
# get the repo root and output path
REPO_ROOT:=${CURDIR}
OUT_DIR=$(REPO_ROOT)/_output
# image building and publishing config
REGISTRY ?= gcr.io/k8s-prow
PROW_IMAGE ?=
################################################################################
# ================================= Testing ====================================
# unit tests (hermetic)
unit: go-unit
.PHONY: unit
go-unit:
hack/make-rules/go-test/unit.sh
.PHONY: go-unit
# integration tests
integration:
test/integration/integration-test.sh
# all tests
test: unit
.PHONY: test
################################################################################
# ============================== Development ===================================
# local development environment (kind cluster with fake external services)
.PHONY: dev
dev:
hack/dev-env.sh
# full dev environment with all Prow components (heavier, matches integration tests)
.PHONY: dev-full
dev-full:
hack/dev-env.sh -profile=full
# Tilt inner loop - run 'make dev' once first, then use this for auto-rebuild
.PHONY: dev-tilt
dev-tilt:
@command -v tilt >/dev/null 2>&1 || { \
echo "ERROR: tilt not found. Install it from https://docs.tilt.dev/install.html"; exit 1; }
@docker inspect -f '{{.State.Running}}' kind-prow-integration-control-plane \
>/dev/null 2>&1 || { \
echo "ERROR: kind cluster not running. Run 'make dev' first."; exit 1; }
tilt up
.PHONY: dev-teardown
dev-teardown:
hack/dev-env.sh -teardown
################################################################################
# ================================= Cleanup ====================================
# standard cleanup target
clean:
rm -rf "$(OUT_DIR)/"
################################################################################
# ============================== Auto-Update ===================================
# update generated code, gofmt, etc.
# update:
# hack/make-rules/update/all.sh
# update generated code
#generate:
# hack/make-rules/update/generated.sh
# gofmt
#gofmt:
# hack/make-rules/update/gofmt.sh
.PHONY: update-go-deps
update-go-deps:
hack/make-rules/update/go-deps.sh
.PHONY: verify-go-deps
verify-go-deps:
hack/make-rules/verify/go-deps.sh
################################################################################
# ================================== Linting ===================================
# run linters, ensure generated code, etc.
.PHONY: verify
verify:
hack/make-rules/verify/all.sh
# go linters
.PHONY: go-lint
go-lint:
hack/make-rules/verify/golangci-lint.sh
.PHONY: update-gofmt
update-gofmt:
hack/make-rules/update/gofmt.sh
.PHONY: verify-gofmt
verify-gofmt:
hack/make-rules/verify/gofmt.sh
.PHONY: update-file-perms
update-file-perms:
hack/make-rules/update/file-perms.sh
.PHONY: verify-file-perms
verify-file-perms:
hack/make-rules/verify/file-perms.sh
.PHONY: update-spelling
update-spelling:
hack/make-rules/update/misspell.sh
.PHONY: verify-spelling
verify-spelling:
hack/make-rules/verify/misspell.sh
.PHONY: update-codegen
update-codegen:
hack/make-rules/update/codegen.sh
.PHONY: verify-codegen
verify-codegen:
hack/make-rules/verify/codegen.sh
.PHONY: verify-boilerplate
verify-boilerplate:
hack/make-rules/verify/boilerplate.sh
#################################################################################
# Build and push specific variables.
REGISTRY ?= gcr.io/k8s-prow
PROW_IMAGE ?=
.PHONY: push-images
push-images:
hack/make-rules/go-run/arbitrary.sh -C ./hack/tools run ./prowimagebuilder --prow-images-file=$(shell pwd)/.prow-images.yaml --ko-docker-repo="${REGISTRY}" --push=true
.PHONY: build-images
build-images:
hack/make-rules/go-run/arbitrary.sh -C ./hack/tools run ./prowimagebuilder --prow-images-file=$(shell pwd)/.prow-images.yaml --ko-docker-repo="ko.local" --push=false
.PHONY: push-single-image
push-single-image:
hack/make-rules/go-run/arbitrary.sh -C ./hack/tools run ./prowimagebuilder --prow-images-file=$(shell pwd)/.prow-images.yaml --ko-docker-repo="${REGISTRY}" --push=true --image=${PROW_IMAGE}
.PHONY: build-single-image
build-single-image:
hack/make-rules/go-run/arbitrary.sh -C ./hack/tools run ./prowimagebuilder --prow-images-file=$(shell pwd)/.prow-images.yaml --ko-docker-repo="ko.local" --push=false --image=${PROW_IMAGE}
.PHONY: build-tarball
build-tarball:
# use --ko-docker-repo="something.not.exist" as ko skips writing `.tar` file if
# it's `ko.local.
hack/make-rules/go-run/arbitrary.sh -C ./hack/tools run ./prowimagebuilder --prow-images-file=$(shell pwd)/.prow-images.yaml --ko-docker-repo="something.not.exist" --push=false --image=${PROW_IMAGE}