Skip to content

Commit

Permalink
Generate version from git tag
Browse files Browse the repository at this point in the history
This drop the need to maintain a separate version file.

See also: kubernetes#1198
  • Loading branch information
mrueg committed Aug 30, 2020
1 parent f1166b4 commit 3c265b9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
8 changes: 3 additions & 5 deletions Makefile
@@ -1,15 +1,13 @@
FLAGS =
TESTENVVAR =
REGISTRY ?= gcr.io/k8s-staging-kube-state-metrics
TAG_PREFIX = v
VERSION = $(shell cat VERSION)
TAG = $(TAG_PREFIX)$(VERSION)
LATEST_RELEASE_BRANCH := release-$(shell grep -ohE "[0-9]+.[0-9]+" VERSION)
TAG ?= $(shell git describe --abbrev=0 --tags 2>/dev/null)
LATEST_RELEASE_BRANCH := release-$(shell echo $(TAG) | grep -ohE "[0-9]+.[0-9]+")
DOCKER_CLI ?= docker
PKGS = $(shell go list ./... | grep -v /vendor/ | grep -v /tests/e2e)
ARCH ?= $(shell go env GOARCH)
BuildDate = $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
Commit = $(shell git rev-parse --short HEAD)
Commit = $(shell git rev-parse --short HEAD 2>/dev/null)
ALL_ARCH = amd64 arm arm64 ppc64le s390x
PKG = k8s.io/kube-state-metrics/pkg
GO_VERSION = 1.14.7
Expand Down
2 changes: 1 addition & 1 deletion RELEASE.md
Expand Up @@ -14,7 +14,7 @@ Maintaining the release branches for older minor releases happens on a best effo

## Prepare your release

* Bump the version in the `VERSION` file in the root of the repository.
* Create a git tag locally
* Run `make examples`, which will re-generate all example manifests to use the new version.
* Make a PR to update:
* kube-state-metrics image tag for both `quay.io` and `gcr.io/k8s-staging-kube-state-metrics`.
Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

0 comments on commit 3c265b9

Please sign in to comment.