forked from teletrace/teletrace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
83 lines (63 loc) · 3.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
ROOT :=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
WEB_ROOT := $(ROOT)/web
SILENT ?= true
OUT_DIR ?= $(ROOT)/out
BIN_DIR := $(OUT_DIR)/bin
# Absolute path list of all the nested Go modules directories within the project
GO_MODULES := $(shell find . -type f -name "go.mod" -exec dirname {} \; | xargs realpath)
ifneq ($(SILENT), false)
.SILENT:
endif
.PHONY: lint lint-fix test
lint: frontend-lint backend-lint
lint-fix: frontend-lint-fix backend-lint-fix
test: frontend-test backend-test
# frontend targets
.PHONY: \
frontend-install \
frontend-lint \
frontend-lint-fix \
frontend-test \
frontend-build
frontend-install:
cd $(WEB_ROOT); yarn install
frontend-lint: frontend-install
cd $(WEB_ROOT); yarn lint
frontend-lint-fix: frontend-install
cd $(WEB_ROOT); yarn lint --fix
frontend-test: frontend-install
cd $(WEB_ROOT); yarn test --watchAll=false --passWithNoTests
frontend-build: frontend-install
cd $(WEB_ROOT); BUILD_PATH=$(BIN_DIR)/web yarn build
# backend targets
.PHONY: \
backend-lint \
backend-lint-fix \
backend-test
backend-lint:
golangci-lint run --sort-results ./...
backend-lint-fix:
golangci-lint run --sort-results --fix ./...
backend-test:
set -e; \
for module in $(GO_MODULES); do \
cd $${module} && \
go test -v ./...; \
done;
.PHONY: backend-coverage
backend-coverage:
./scripts/backend-coverage.sh ${ROOT} ${GO_MODULES}
.PHONY: all-in-one
all-in-one:
docker build --build-arg BUILD_INFO=$(git describe --tags) -f $(ROOT)/cmd/all-in-one/Dockerfile -t teletrace-aio:latest .
.PHONY: update-license-headers
update-license-headers: bin/license-header-checker
bin/license-header-checker -v -a -r -i node_modules,web/src/features/trace/components/TraceTimeline,deploy/demo,tests/e2e/playwright/playwright.config.ts,teletrace-otelcol/exporter/elasticsearchexporter/trace_exporter.go,teletrace-otelcol/exporter/elasticsearchexporter/writer.go,teletrace-otelcol/exporter/opensearchexporter/trace_exporter.go,teletrace-otelcol/exporter/opensearchexporter/writer.go,web/src/components/Elements/BasicElements/Accordion.stories.tsx,web/src/components/Elements/BasicElements/Autocomplete.stories.tsx,web/src/components/Elements/BasicElements/Dialog.stories.tsx,web/src/components/Elements/BasicElements/Drawer.stories.tsx,web/src/components/Elements/BasicElements/List.stories.tsx,web/src/components/Elements/BasicElements/Snackbar.stories.tsx,web/src/components/Elements/BasicElements/TextField.stories.tsx,web/src/components/Elements/BasicElements/ToggleButtonGroup.stories.tsx,web/src/components/Elements/BasicElements/Tooltip.stories.tsx,web/src/components/Elements/BasicElements/Typography.stories.tsx .github/license_header.txt . ts tsx js go css
bin/license-header-checker:
curl -s https://raw.githubusercontent.com/lluissm/license-header-checker/master/install.sh | bash
.PHONY: list
list:
@LC_ALL=C $(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | \
awk -v RS= -F: '/(^|\n)# Files(\n|$$)/,/(^|\n)# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | \
sort | \
egrep -v -e '^[^[:alnum:]]' -e '^$@$$'