-
Notifications
You must be signed in to change notification settings - Fork 226
/
Copy pathMakefile
91 lines (74 loc) · 2.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
CMD_DOCKER ?= docker
CMD_GIT ?= git
ifeq ($(GITHUB_BRANCH_NAME),)
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)-
else
BRANCH := $(GITHUB_BRANCH_NAME)-
endif
ifeq ($(GITHUB_SHA),)
COMMIT := $(shell git describe --no-match --dirty --always --abbrev=8)
else
COMMIT := $(shell echo $(GITHUB_SHA) | cut -c1-8)
endif
VERSION ?= $(if $(RELEASE_TAG),$(RELEASE_TAG),$(shell $(CMD_GIT) describe --tags 2>/dev/null || echo '$(BRANCH)$(COMMIT)'))
OUT_DOCKER ?= ghcr.io/parca-dev/parca
.PHONY: clean
clean:
rm -r bin
rm -r ui/dist
rm -r ui/.next
.PHONY: build
build: ui go/bin
.PHONY: go/bin
go/bin:
mkdir -p ./bin
go build -o bin/ ./cmd/parca
cp parca.yaml bin/
.PHONY: format
format: go-fmt check-license
.PHONY: go-fmt
go-fmt:
go fmt ./...
.PHONY: check-license
check-license:
./scripts/check-license.sh
.PHONY: ui
ui:
cd ui && yarn install && yarn workspace @parca/web build
.PHONY: proto/lint
proto/lint:
# docker run --volume ${PWD}:/workspace --workdir /workspace bufbuild/buf lint
buf lint
.PHONY: proto/generate
proto/generate:
yarn install
# Generate just the annotations and http protos.
buf generate buf.build/googleapis/googleapis --path google/api/annotations.proto --path google/api/http.proto
buf generate
.PHONY: proto/vendor
proto/vendor:
buf mod update
mkdir -p proto/google/pprof
curl https://raw.githubusercontent.com/google/pprof/master/proto/profile.proto > proto/google/pprof/profile.proto
.PHONY: container
container:
buildah build-using-dockerfile --build-arg TOKEN --timestamp 0 --layers -t $(OUT_DOCKER):$(VERSION)
.PHONY: push-container
push-container:
buildah push $(OUT_DOCKER):$(VERSION)
.PHONY: push-quay-container
push-quay-container:
buildah push $(OUT_DOCKER):$(VERSION) quay.io/parca/parca:$(VERSION)
.PHONY: deploy/manifests
deploy/manifests:
cd deploy && make manifests
.PHONY: dev/setup
dev/setup:
./env.sh
./env-jsonnet.sh
.PHONY: dev/up
dev/up: deploy/manifests
source ./scripts/local-dev.sh && up
.PHONY: dev/down
dev/down:
source ./scripts/local-dev.sh && down