forked from open-telemetry/opentelemetry-demo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
86 lines (69 loc) · 2.45 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
# All documents to be used in spell check.
ALL_DOCS := $(shell find . -type f -name '*.md' -not -path './.github/*' -not -path '*/node_modules/*' -not -path '*/_build/*' -not -path '*/deps/*' | sort)
PWD := $(shell pwd)
TOOLS_DIR := ./internal/tools
MISSPELL_BINARY=bin/misspell
MISSPELL = $(TOOLS_DIR)/$(MISSPELL_BINARY)
# see https://github.com/open-telemetry/build-tools/releases for semconvgen updates
# Keep links in semantic_conventions/README.md and .vscode/settings.json in sync!
SEMCONVGEN_VERSION=0.11.0
# TODO: add `yamllint` step to `all` after making sure it works on Mac.
.PHONY: all
all: install-tools markdownlint misspell
$(MISSPELL):
cd $(TOOLS_DIR) && go build -o $(MISSPELL_BINARY) github.com/client9/misspell/cmd/misspell
.PHONY: misspell
misspell: $(MISSPELL)
$(MISSPELL) -error $(ALL_DOCS)
.PHONY: misspell-correction
misspell-correction: $(MISSPELL)
$(MISSPELL) -w $(ALL_DOCS)
.PHONY: markdownlint
markdownlint:
@if ! npm ls markdownlint; then npm install; fi
@for f in $(ALL_DOCS); do \
echo $$f; \
npx --no -p markdownlint-cli markdownlint -c .markdownlint.yaml $$f \
|| exit 1; \
done
.PHONY: install-yamllint
install-yamllint:
# Using a venv is recommended
pip install -U yamllint~=1.26.1
.PHONY: yamllint
yamllint:
yamllint .
# Run all checks in order of speed / likely failure.
.PHONY: check
check: misspell markdownlint
@echo "All checks complete"
# Attempt to fix issues / regenerate tables.
.PHONY: fix
fix: misspell-correction
@echo "All autofixes complete"
.PHONY: install-tools
install-tools: $(MISSPELL)
npm install
@echo "All tools installed"
.PHONY: build-and-push-dockerhub
build-and-push-dockerhub:
docker compose --env-file .dockerhub.env -f docker-compose.yml build
docker compose --env-file .dockerhub.env -f docker-compose.yml push
.PHONY: build-and-push-ghcr
build-and-push-ghcr:
docker compose --env-file .ghcr.env -f docker-compose.yml build
docker compose --env-file .ghcr.env -f docker-compose.yml push
.PHONY: build-env-file
build-env-file:
cp .env .dockerhub.env
sed -i '/IMAGE_VERSION=.*/c\IMAGE_VERSION=${RELEASE_VERSION}' .dockerhub.env
sed -i '/IMAGE_NAME=.*/c\IMAGE_NAME=${DOCKERHUB_REPO}' .dockerhub.env
cp .env .ghcr.env
sed -i '/IMAGE_VERSION=.*/c\IMAGE_VERSION=${RELEASE_VERSION}' .ghcr.env
sed -i '/IMAGE_NAME=.*/c\IMAGE_NAME=${GHCR_REPO}' .ghcr.env
run-tests:
docker compose run frontendTests
docker compose run integrationTests
.PHONY: generate-protobuf
generate-protobuf:
./ide-gen-proto.sh