forked from gardener/machine-controller-manager-provider-gcp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
112 lines (94 loc) · 3.15 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
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
#
# SPDX-License-Identifier: Apache-2.0
MCM_DIR := $(shell go list -m -f "{{.Dir}}" github.com/gardener/machine-controller-manager)
TOOLS_DIR := hack/tools
include $(MCM_DIR)/hack/tools.mk
-include .env
export
PROVIDER_NAME := Gcp
PROJECT_NAME := gardener
BINARY_PATH := bin/
IMAGE_REPOSITORY := europe-docker.pkg.dev/gardener-project/public/gardener/machine-controller-manager-provider-gcp
IMAGE_TAG := $(shell cat VERSION)
MACHINE_CONTROLLER_MANAGER_DEPLOYMENT_NAME := machine-controller-manager
TAGS_ARE_STRINGS := true
LEADER_ELECT := "true"
#########################################
# Rules for starting machine-controller locally
#########################################
.PHONY: start
start:
@GO111MODULE=on go run \
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 \
--v=3
#########################################
# Rules for checks
#########################################
.PHONY: check
check:
.ci/check
#########################################
# Rules for tidying
#########################################
.PHONY: tidy
tidy:
@env GO111MODULE=on go mod tidy -v
#########################################
# Rules for testing
#########################################
.PHONY: test-unit
test-unit:
@SKIP_INTEGRATION_TESTS=X .ci/test
.PHONY: test-integration
test-integration:
.ci/local_integration_test
#########################################
# Rules for build/release
#########################################
.PHONY: release
release: build-local build docker-image docker-push rename-binaries
.PHONY: build-local
build-local:
@env LOCAL_BUILD=1 .ci/build
.PHONY: build
build:
@.ci/build
PLATFORM ?= linux/amd64
.PHONY: docker-image
docker-image:
@docker buildx build --platform $(PLATFORM) -t $(IMAGE_REPOSITORY):$(IMAGE_TAG) .
.PHONY: docker-push
docker-push:
@if ! docker images $(IMAGE_REPOSITORY) | awk '{ print $$2 }' | grep -q -F $(IMAGE_TAG); then echo "$(IMAGE_REPOSITORY) version $(IMAGE_TAG) is not yet built. Please run 'make docker-images'"; false; fi
@gcloud docker -- push $(IMAGE_REPOSITORY):$(IMAGE_TAG)
.PHONY: rename-binaries
rename-binaries:
@if [[ -f bin/machine-controller ]]; then cp bin/machine-controller machine-controller-darwin-amd64; fi
@if [[ -f bin/rel/machine-controller ]]; then cp bin/rel/machine-controller machine-controller-linux-amd64; fi
.PHONY: clean
clean:
@rm -rf bin/
@rm -f *linux-amd64
@rm -f *darwin-amd64
generate:
@./hack/api-reference/generate-spec-doc.sh
.PHONY: add-license-headers
add-license-headers: $(GO_ADD_LICENSE)
@./hack/add_license_headers.sh ${YEAR}
.PHONY: sast
sast: $(GOSEC)
@./hack/sast.sh
.PHONY: sast-report
sast-report: $(GOSEC)
@./hack/sast.sh --gosec-report true