-
Notifications
You must be signed in to change notification settings - Fork 101
/
Makefile
74 lines (58 loc) · 1.8 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
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Gardener contributors
#
# SPDX-License-Identifier: Apache-2.0
VERSION ?= $(shell cat VERSION)
REGISTRY ?= europe-docker.pkg.dev/gardener-project/snapshots
IMAGE_REPOSITORY := $(REGISTRY)/gardener/etcdbrctl
IMAGE_TAG := $(VERSION)
BUILD_DIR := build
PLATFORM ?= $(shell docker info --format '{{.OSType}}/{{.Architecture}}')
BIN_DIR := bin
COVERPROFILE := test/output/coverprofile.out
IMG ?= ${IMAGE_REPOSITORY}:${IMAGE_TAG}
.DEFAULT_GOAL := build-local
.PHONY: revendor
revendor:
@env go mod tidy -v
@env go mod vendor -v
.PHONY: update-dependencies
update-dependencies:
@env go get -u
@make revendor
.PHONY: build
build:
@.ci/build
.PHONY: build-local
build-local:
@env LOCAL_BUILD=1 .ci/build
.PHONY: docker-build
docker-build:
docker buildx build --platform=$(PLATFORM) --tag $(IMG) -f $(BUILD_DIR)/Dockerfile --rm .
.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-image'"; false; fi
@docker push ${IMG}
.PHONY: clean
clean:
@rm -rf $(BIN_DIR)/
.PHONY: verify
verify: check test
.PHONY: check
check:
@.ci/check
.PHONY: test
test:
.ci/unit_test
.PHONY: perf-regression-test
perf-regression-test:
@.ci/performance_regression_test
.PHONY: integration-test
integration-test:
@.ci/integration_test
.PHONY: integration-test-cluster
integration-test-cluster:
@.ci/integration_test cluster
.PHONY: show-coverage
show-coverage:
@if [ ! -f $(COVERPROFILE) ]; then echo "$(COVERPROFILE) is not yet built. Please run 'COVER=true make test'"; false; fi
@go tool cover -html $(COVERPROFILE)