Skip to content

Commit 2089503

Browse files
authored
Merge pull request #2361 from mrueg/template-more
chore: Replace VERSION file with data.yaml
2 parents d4ae486 + 7aa1659 commit 2089503

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ FLAGS =
22
TESTENVVAR =
33
REGISTRY ?= gcr.io/k8s-staging-kube-state-metrics
44
TAG_PREFIX = v
5-
VERSION = $(shell cat VERSION)
5+
VERSION = $(shell gomplate -d config=./data.yaml --in '{{ (datasource "config").version }}')
66
TAG ?= $(TAG_PREFIX)$(VERSION)
7-
LATEST_RELEASE_BRANCH := release-$(shell grep -ohE "[0-9]+.[0-9]+" VERSION)
7+
LATEST_RELEASE_BRANCH := release-$(shell echo $(VERSION) | grep -ohE "[0-9]+.[0-9]+")
88
BRANCH = $(strip $(shell git rev-parse --abbrev-ref HEAD))
99
DOCKER_CLI ?= docker
1010
PROMTOOL_CLI ?= promtool
@@ -151,17 +151,17 @@ examples/prometheus-alerting-rules/alerts.yaml: jsonnet $(shell find jsonnet | g
151151

152152
examples: examples/standard examples/autosharding examples/daemonsetsharding mixin
153153

154-
examples/standard: jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/standard.jsonnet scripts/vendor VERSION
154+
examples/standard: jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/standard.jsonnet scripts/vendor
155155
mkdir -p examples/standard
156156
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' -- {}
157157
find examples -type f ! -name '*.yaml' -delete
158158

159-
examples/autosharding: jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/autosharding.jsonnet scripts/vendor VERSION
159+
examples/autosharding: jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/autosharding.jsonnet scripts/vendor
160160
mkdir -p examples/autosharding
161161
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' -- {}
162162
find examples -type f ! -name '*.yaml' -delete
163163

164-
examples/daemonsetsharding: jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/daemonsetsharding.jsonnet scripts/vendor VERSION
164+
examples/daemonsetsharding: jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/daemonsetsharding.jsonnet scripts/vendor
165165
mkdir -p examples/daemonsetsharding
166166
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' -- {}
167167
find examples -type f ! -name '*.yaml' -delete

RELEASE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ Maintaining the release branches for older minor releases happens on a best effo
1414

1515
## Prepare your release
1616

17-
* Bump the version in the `VERSION` file in the root of the repository.
17+
* Update the [data.yaml](data.yaml)
18+
* Update the compat list
19+
* Update the version key to refer to your new release
1820
* Run `make examples`, which will re-generate all example manifests to use the new version.
1921
* Make a PR to update:
20-
* Update the [[`data.yaml`](data.yaml)
2122
* Run `make generate`, which will update the compatibility matrix in README.md
2223
* Changelog entry
2324
* Only include user relevant changes

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

data.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# The purpose of this config is to keep all versions in a single file and make them machine accessible
2+
3+
# Marks the latest release
4+
version: "2.12.0"
5+
16
# List at max 5 releases here + the main branch
27
compat:
38
- version: "v2.8.2"

0 commit comments

Comments
 (0)