@@ -6,8 +6,6 @@ VERSION = $(shell grep '^version:' data.yaml | grep -oE "[0-9]+.[0-9]+.[0-9]+")
6
6
TAG ?= $(TAG_PREFIX )$(VERSION )
7
7
LATEST_RELEASE_BRANCH := release-$(shell echo $(VERSION ) | grep -ohE "[0-9]+.[0-9]+")
8
8
BRANCH = $(strip $(shell git rev-parse --abbrev-ref HEAD) )
9
- DOCKER_CLI ?= docker
10
- PROMTOOL_CLI ?= promtool
11
9
PKGS = $(shell go list ./... | grep -v /vendor/ | grep -v /tests/e2e)
12
10
ARCH ?= $(shell go env GOARCH)
13
11
BUILD_DATE = $(shell date -u +'% Y-% m-% dT% H:% M:% SZ')
@@ -16,13 +14,20 @@ OS ?= $(shell uname -s | tr A-Z a-z)
16
14
ALL_ARCH = amd64 arm arm64 ppc64le s390x
17
15
PKG = github.com/prometheus/common
18
16
PROMETHEUS_VERSION = 2.55.1
19
- GO_VERSION = 1.23.5
17
+ GO_VERSION = 1.24.1
20
18
IMAGE = $(REGISTRY ) /kube-state-metrics
21
19
MULTI_ARCH_IMG = $(IMAGE ) -$(ARCH )
22
20
USER ?= $(shell id -u -n)
23
21
HOST ?= $(shell hostname)
24
22
MARKDOWNLINT_CLI2_VERSION = 0.17.2
25
23
24
+ DOCKER_CLI ?= docker
25
+ PROMTOOL_CLI ?= promtool
26
+ GOMPLATE_CLI ?= go tool github.com/hairyhenderson/gomplate/v4/cmd/gomplate
27
+ GOJSONTOYAML_CLI ?= go tool github.com/brancz/gojsontoyaml
28
+ EMBEDMD_CLI ?= go tool github.com/campoy/embedmd
29
+ JSONNET_CLI ?= go tool github.com/google/go-jsonnet/cmd/jsonnet
30
+ JB_CLI ?= go tool github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb
26
31
27
32
export DOCKER_CLI_EXPERIMENTAL =enabled
28
33
@@ -88,7 +93,7 @@ fix-markdown-format:
88
93
${DOCKER_CLI} run -v " ${PWD} :/workdir" davidanson/markdownlint-cli2:v${MARKDOWNLINT_CLI2_VERSION} --fix --config .markdownlint-cli2.jsonc
89
94
90
95
generate-template :
91
- gomplate -d config=./data.yaml --file README.md.tpl > README.md
96
+ ${GOMPLATE_CLI} -d config=./data.yaml --file README.md.tpl > README.md
92
97
93
98
validate-template : generate-template
94
99
git diff --no-ext-diff --quiet --exit-code README.md
138
143
generate : build-local generate-template
139
144
@echo " >> generating docs"
140
145
@./scripts/generate-help-text.sh
141
- embedmd -w ` find . -path ./vendor -prune -o -name " *.md" -print`
146
+ ${EMBEDMD_CLI} -w ` find . -path ./vendor -prune -o -name " *.md" -print`
142
147
143
148
validate-manifests : examples
144
149
@git diff --exit-code
@@ -147,31 +152,27 @@ mixin: examples/prometheus-alerting-rules/alerts.yaml
147
152
148
153
examples/prometheus-alerting-rules/alerts.yaml : jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/mixin.jsonnet scripts/vendor
149
154
mkdir -p examples/prometheus-alerting-rules
150
- jsonnet -J scripts/vendor scripts/mixin.jsonnet | gojsontoyaml > examples/prometheus-alerting-rules/alerts.yaml
155
+ ${JSONNET_CLI} -J scripts/vendor scripts/mixin.jsonnet | ${GOJSONTOYAML_CLI} > examples/prometheus-alerting-rules/alerts.yaml
151
156
152
157
examples : examples/standard examples/autosharding examples/daemonsetsharding mixin
153
158
154
159
examples/standard : jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/standard.jsonnet scripts/vendor
155
160
mkdir -p examples/standard
156
- jsonnet -J scripts/vendor -m examples/standard --ext-str version=" $( VERSION) " scripts/standard.jsonnet | xargs -I{} sh -c ' cat {} | gojsontoyaml > `echo {} | sed "s/\(.\)\([A-Z]\)/\1-\2/g" | tr "[:upper:]" "[:lower:]"`.yaml' -- {}
161
+ ${JSONNET_CLI} } -J scripts/vendor -m examples/standard --ext-str version=" $( VERSION) " scripts/standard.jsonnet | xargs -I{} sh -c ' cat {} | ${GOJSONTOYAML_CLI} > `echo {} | sed "s/\(.\)\([A-Z]\)/\1-\2/g" | tr "[:upper:]" "[:lower:]"`.yaml' -- {}
157
162
find examples -type f ! -name ' *.yaml' -delete
158
163
159
164
examples/autosharding : jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/autosharding.jsonnet scripts/vendor
160
165
mkdir -p examples/autosharding
161
- jsonnet -J scripts/vendor -m examples/autosharding --ext-str version=" $( VERSION) " scripts/autosharding.jsonnet | xargs -I{} sh -c ' cat {} | gojsontoyaml > `echo {} | sed "s/\(.\)\([A-Z]\)/\1-\2/g" | tr "[:upper:]" "[:lower:]"`.yaml' -- {}
166
+ ${JSONNET_CLI} -J scripts/vendor -m examples/autosharding --ext-str version=" $( VERSION) " scripts/autosharding.jsonnet | xargs -I{} sh -c ' cat {} | ${GOJSONTOYAML_CLI} > `echo {} | sed "s/\(.\)\([A-Z]\)/\1-\2/g" | tr "[:upper:]" "[:lower:]"`.yaml' -- {}
162
167
find examples -type f ! -name ' *.yaml' -delete
163
168
164
169
examples/daemonsetsharding : jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/daemonsetsharding.jsonnet scripts/vendor
165
170
mkdir -p examples/daemonsetsharding
166
- jsonnet -J scripts/vendor -m examples/daemonsetsharding --ext-str version=" $( VERSION) " scripts/daemonsetsharding.jsonnet | xargs -I{} sh -c ' cat {} | gojsontoyaml > `echo {} | sed "s/\(.\)\([A-Z]\)/\1-\2/g" | tr "[:upper:]" "[:lower:]"`.yaml' -- {}
171
+ ${JSONETT_CLI} -J scripts/vendor -m examples/daemonsetsharding --ext-str version=" $( VERSION) " scripts/daemonsetsharding.jsonnet | xargs -I{} sh -c ' cat {} | ${GOJSONTOYAML_CLI} > `echo {} | sed "s/\(.\)\([A-Z]\)/\1-\2/g" | tr "[:upper:]" "[:lower:]"`.yaml' -- {}
167
172
find examples -type f ! -name ' *.yaml' -delete
168
173
169
174
scripts/vendor : scripts/jsonnetfile.json scripts/jsonnetfile.lock.json
170
- cd scripts && jb install
171
-
172
- install-tools :
173
- @echo Installing tools from tools.go
174
- grep ' ^\s*_' tools/tools.go | awk ' {print $$2}' | xargs -tI % go install -mod=readonly -modfile=tools/go.mod %
175
+ cd scripts && ${JB_CLI} install
175
176
176
177
install-promtool :
177
178
@echo Installing promtool
0 commit comments