forked from grafana/pyroscope-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
95 lines (75 loc) · 1.88 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
include docker/*.mk
USE_CONTAINER ?= 0
CARGO_TARGET_DIR ?= target
ifeq ($(USE_CONTAINER),1)
CARGO_TARGET_DIR := ./.tmp/target_container
endif
PROPAGATE_VARS := CARGO_TARGET_DIR
COMMIT = $(shell git rev-parse --short HEAD)
DOCKER_EXTRA ?=
DOCKER_BUILDKIT=1
.PHONY: cli/test
cli/test:
ifeq ($(USE_CONTAINER),1)
$(RERUN_IN_CONTAINER)
else
cargo test --manifest-path pyroscope_cli/Cargo.toml
endif
#, pprofrs, pyspy, rbspy, ffikit
.PHONY: lib/test
lib/test:
ifeq ($(USE_CONTAINER),1)
$(RERUN_IN_CONTAINER)
else
cargo test --manifest-path Cargo.toml
endif
.PHONY: pprofrs/test
pprofrs/test:
ifeq ($(USE_CONTAINER),1)
$(RERUN_IN_CONTAINER)
else
cargo test --manifest-path pyroscope_backends/pyroscope_pprofrs/Cargo.toml
endif
.PHONY: pyspy/test
pyspy/test:
ifeq ($(USE_CONTAINER),1)
$(RERUN_IN_CONTAINER)
else
cargo test --manifest-path pyroscope_backends/pyroscope_pyspy/Cargo.toml
endif
.PHONY: rbspy/test
rbspy/test:
ifeq ($(USE_CONTAINER),1)
$(RERUN_IN_CONTAINER)
else
cargo test --manifest-path pyroscope_backends/pyroscope_rbspy/Cargo.toml
endif
.PHONY: ffikit/test
ffikit/test:
ifeq ($(USE_CONTAINER),1)
$(RERUN_IN_CONTAINER)
else
cargo test --manifest-path pyroscope_ffi/ffikit/Cargo.toml
endif
.PHONY: test
test: cli/test pprofrs/test pyspy/test rbspy/test lib/test ffikit/test
.PHONY: cli/version
cli/version:
ifeq ($(USE_CONTAINER),1)
$(RERUN_IN_CONTAINER)
else
@ cd pyroscope_cli && cargo pkgid | cut -d @ -f 2
endif
.PHONY: cli/docker-image
cli/docker-image:
docker buildx build \
--platform linux/amd64 \
-t pyroscope/pyroscope-rs-cli:$(shell make cli/version)-$(COMMIT) \
-f docker/Dockerfile.cli $(DOCKER_EXTRA) \
.
# CI
drone:
drone jsonnet -V BUILD_IMAGE_VERSION=$(BUILD_IMAGE_VERSION) --stream --format --source .drone/drone.jsonnet --target .drone/drone.yml
drone lint .drone/drone.yml
drone sign --save grafana/pyroscope-rs .drone/drone.yml
include ffi.mk