-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathMakefile
72 lines (55 loc) · 1.64 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
# Copyright 2019 PingCAP, Inc.
#
# 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,
# See the License for the specific language governing permissions and
# limitations under the License.
LDFLAGS ?= $(shell ./hack/version.sh)
GO := go
ARCH ?= $(shell go env GOARCH)
OS ?= $(shell go env GOOS)
DOCKER_REGISTRY ?= localhost:5000
DOCKER_REPO ?= ${DOCKER_REGISTRY}/pingcap
IMAGE_TAG ?= latest
ALL_TARGETS := cmd/controller-manager
SRC_PREFIX := github.com/pingcap/advanced-statefulset
GIT_VERSION = $(shell ./hack/version.sh | awk -F': ' '/^GIT_VERSION:/ {print $$2}')
all: build
.PHONY: all
verify: verify-client
./hack/verify-all.sh
.PHONY: verify
verify-client:
make -C client verify
.PHONY: verify-client
build: $(ALL_TARGETS)
.PHONY: all
$(ALL_TARGETS):
GOOS=$(OS) GOARCH=$(ARCH) CGO_ENABLED=0 $(GO) build -ldflags "${LDFLAGS}" -o output/bin/$(OS)/$@ $(SRC_PREFIX)/$@
.PHONY: $(ALL_TARGETS)
docker:
docker build --tag "${DOCKER_REPO}/advanced-statefulset:${IMAGE_TAG}" .
test: test-client
hack/make-rules/test.sh $(WHAT)
.PHONY: test
test-client:
make -C client test
.PHONY: test-client
test-integration: openapi-spec
hack/make-rules/test-integration.sh $(WHAT)
.PHONY: test-integration
e2e:
hack/e2e.sh
.PHONY: e2e
e2e-examples:
hack/e2e-examples.sh
.PHONY: e2e-examples
openapi-spec:
hack/generate-kube-openapi.sh
.PHONY: openapi-spec