forked from kubernetes-sigs/scheduler-plugins
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile.kni
92 lines (71 loc) · 2.89 KB
/
Makefile.kni
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
# Copyright 2020 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.
COMMONENVVAR=GOOS=$(shell uname -s | tr A-Z a-z)
BUILDENVVAR=
CONTAINER_REGISTRY?="quay.io/openshift-kni"
CONTAINER_IMAGE?="scheduler-plugins"
RELEASE_SEQUENTIAL?=01
RELEASE_VERSION?=devel-v0.0.$(shell date +%Y%m%d)$(RELEASE_SEQUENTIAL)
# VERSION is the scheduler's version
#
# The RELEASE_VERSION variable can have one of the following formats:
# v20201009-v0.18.800-46-g939c1c0 - automated build for a commit(not a tag) and also a local build
# v20200521-v0.18.800 - automated build for a tag
VERSION=$(shell echo $(RELEASE_VERSION) | awk -F - '{print $$2}')
.PHONY: all
all: image
.PHONY: image
image: build-noderesourcetopology-image
.PHONY: build
build: build-noderesourcetopology-plugin
.PHONY: image
image: build-noderesourcetopology-image
.PHONY: build.amd64
build.amd64: build-scheduler.amd64 build-noderesourcetopology-plugin.amd64
.PHONY: build-noderesourcetopology-plugin
build-noderesourcetopology-plugin: update-vendor
$(COMMONENVVAR) $(BUILDENVVAR) go build -ldflags '-X k8s.io/component-base/version.gitVersion=$(VERSION) -w' -o bin/noderesourcetopology-plugin cmd/noderesourcetopology-plugin/main.go
.PHONY: build-noderesourcetopology-plugin.amd64
build-noderesourcetopology-plugin.amd64: update-vendor
$(COMMONENVVAR) $(BUILDENVVAR) GOARCH=amd64 go build -ldflags '-X k8s.io/component-base/version.gitVersion=$(VERSION) -w' -o bin/noderesourcetopology-plugin cmd/noderesourcetopology-plugin/main.go
.PHONY: local-noderesourcetopology-image
build-noderesourcetopology-image: clean
podman build -f ./build/noderesourcetopology-plugin/Dockerfile --build-arg ARCH="amd64" --build-arg RELEASE_VERSION="$(RELEASE_VERSION)" -t $(CONTAINER_REGISTRY)/$(CONTAINER_IMAGE):$(VERSION) .
.PHONY: update-vendor
update-vendor:
hack/update-vendor.sh
.PHONY: unit-test
unit-test: update-vendor
hack/unit-test.sh
.PHONY: unit-test-quick
unit-test-quick: update-vendor
hack-kni/unit-test-quick.sh
.PHONY: install-envtest
install-envtest: update-vendor
hack-kni/install-envtest.sh
.PHONY: integration-test
integration-test: install-envtest
hack/integration-test.sh
.PHONY: integration-test
integration-test-quick: install-envtest
hack-kni/integration-test-quick.sh
.PHONY: verify-gofmt
verify-gofmt:
hack/verify-gofmt.sh
.PHONY: verify-crdgen
verify-crdgen: update-vendor
hack/verify-crdgen.sh
.PHONY: clean
clean:
rm -rf ./bin