This repository has been archived by the owner on May 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
94 lines (75 loc) · 3.17 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
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
#
# SPDX-License-Identifier: Apache-2.0
REPO_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
LEADER_ELECT := false
#TODO (rishabh-11): Remove this version assignment when g/g v1.79.0 or later version is vendored.
GOLANGCI_LINT_VERSION ?= v1.54.2
#####################################################################
# Tools #
#####################################################################
TOOLS_DIR := hack/tools
include $(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/tools.mk
#####################################################################
# Rules for starting machine-controller locally #
#####################################################################
.PHONY: start
start:
@GO111MODULE=on \
go run \
-mod=vendor \
cmd/machine-controller/main.go \
--control-kubeconfig=$(CONTROL_KUBECONFIG) \
--target-kubeconfig=$(TARGET_KUBECONFIG) \
--namespace=$(CONTROL_NAMESPACE) \
--machine-creation-timeout=20m \
--machine-drain-timeout=5m \
--machine-health-timeout=10m \
--machine-pv-detach-timeout=2m \
--machine-safety-apiserver-statuscheck-timeout=30s \
--machine-safety-apiserver-statuscheck-period=1m \
--machine-safety-orphan-vms-period=30m \
--leader-elect=$(LEADER_ELECT) \
--v=3
#####################################################################
# Rules related to binary build, Docker image build and release #
#####################################################################
.PHONY: install
install:
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/install.sh ./...
#####################################################################
# Rules for verification, formatting, linting, testing and cleaning #
#####################################################################
.PHONY: revendor
revendor:
@GO111MODULE=on go mod tidy
@GO111MODULE=on go mod vendor
@chmod +x $(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/*
.PHONY: clean
clean:
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/clean.sh ./cmd/... ./pkg/...
.PHONY: check-generate
check-generate:
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/check-generate.sh $(REPO_ROOT)
.PHONY: check
check: $(GOIMPORTS) $(GOLANGCI_LINT)
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/check.sh --golangci-lint-config=./.golangci.yaml ./cmd/... ./pkg/...
.PHONY: generate
generate:
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/generate.sh ./cmd/... ./pkg/...
.PHONY: format
format: $(GOIMPORTS) $(GOIMPORTSREVISER)
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/format.sh ./cmd ./pkg
.PHONY: test
test:
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/test.sh ./cmd/... ./pkg/...
.PHONY: test-cov
test-cov:
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/test-cover.sh ./cmd/... ./pkg/...
.PHONY: test-clean
test-clean:
@$(REPO_ROOT)/vendor/github.com/gardener/gardener/hack/test-cover-clean.sh
.PHONY: verify
verify: check format test
.PHONY: verify-extended
verify-extended: check-generate check format test-cov test-clean