forked from kubevirt/managed-tenant-quota
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·115 lines (88 loc) · 3.04 KB
/
Makefile
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
#Copyright 2023 The MTQ 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.
.PHONY: manifests \
cluster-up cluster-down cluster-sync \
test test-functional test-unit test-lint \
publish \
mtq_controller \
mtq_lock_server \
mtq_operator \
fmt \
goveralls \
release-description \
bazel-build-images push-images \
fossa
all: build
build: mtq_controller mtq_lock_server mtq_operator
DOCKER?=1
ifeq (${DOCKER}, 1)
# use entrypoint.sh (default) as your entrypoint into the container
DO=./hack/build/in-docker.sh
# use entrypoint-bazel.sh as your entrypoint into the container.
DO_BAZ=./hack/build/bazel-docker.sh
else
DO=eval
DO_BAZ=eval
endif
ifeq ($(origin KUBEVIRT_RELEASE), undefined)
KUBEVIRT_RELEASE="latest_nightly"
endif
all: manifests build-images
manifests:
${DO_BAZ} "DOCKER_PREFIX=${DOCKER_PREFIX} DOCKER_TAG=${DOCKER_TAG} VERBOSITY=${VERBOSITY} PULL_POLICY=${PULL_POLICY} CR_NAME=${CR_NAME} MTQ_NAMESPACE=${MTQ_NAMESPACE} ./hack/build/build-manifests.sh"
builder-push:
./hack/build/bazel-build-builder.sh
generate:
${DO_BAZ} "./hack/update-codegen.sh"
generate-verify: generate
./hack/verify-generate.sh
./hack/check-for-binaries.sh
cluster-up:
eval "KUBEVIRT_RELEASE=${KUBEVIRT_RELEASE} ./cluster-up/up.sh"
cluster-down:
./cluster-up/down.sh
push-images:
eval "DOCKER_PREFIX=${DOCKER_PREFIX} DOCKER_TAG=${DOCKER_TAG} ./hack/build/build-docker.sh push"
build-images:
eval "DOCKER_PREFIX=${DOCKER_PREFIX} DOCKER_TAG=${DOCKER_TAG} ./hack/build/build-docker.sh"
push: build-images push-images
cluster-clean-mtq:
./cluster-sync/clean.sh
cluster-sync: cluster-clean-mtq
./cluster-sync/sync.sh MTQ_AVAILABLE_TIMEOUT=${MTQ_AVAILABLE_TIMEOUT} DOCKER_PREFIX=${DOCKER_PREFIX} DOCKER_TAG=${DOCKER_TAG} PULL_POLICY=${PULL_POLICY} MTQ_NAMESPACE=${MTQ_NAMESPACE}
test: WHAT = ./pkg/... ./cmd/...
test: bootstrap-ginkgo
${DO_BAZ} "ACK_GINKGO_DEPRECATIONS=${ACK_GINKGO_DEPRECATIONS} ./hack/build/run-unit-tests.sh ${WHAT}"
build-functest:
${DO_BAZ} ./hack/build/build-functest.sh
functest: WHAT = ./tests/...
functest: build-functest
./hack/build/run-functional-tests.sh ${WHAT} "${TEST_ARGS}"
bootstrap-ginkgo:
${DO_BAZ} ./hack/build/bootstrap-ginkgo.sh
mtq_controller:
go build -o mtq_controller -v cmd/mtq-controller/*.go
chmod 777 mtq_controller
mtq_operator:
go build -o mtq_operator -v cmd/mtq-operator/*.go
chmod 777 mtq_operator
mtq_lock_server:
go build -o mtq_lock_server -v cmd/mtq-lock-server/*.go
chmod 777 mtq_lock_server
clean:
rm ./mtq_controller ./mtq_operator ./mtq_lock_server -f
fmt:
go fmt .
run: build
sudo ./mtq_controller