Skip to content

Commit

Permalink
Always use --tags arg for git describe
Browse files Browse the repository at this point in the history
Consistently use --tags for git describe everywhere so that version
numbering matches when unannotated tags are present.

Signed-off-by: Markus Lehtonen <[email protected]>
  • Loading branch information
marquiz committed Mar 28, 2024
1 parent b4bfeaf commit ae97c82
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/package-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
# For unstable chart verison we use:
# - chart version: x.y-unstable derived from the latest tag x.y.z
# - image version: 'unstable'.
majmin="$(git describe | sed -E 's/(v[0-9]*\.[0-9]*).*$/\1/')"
majmin="$(git describe --tags | sed -E 's/(v[0-9]*\.[0-9]*).*$/\1/')"
CHART_VERSION="${majmin}-unstable"
if [ $GITHUB_REF_NAME = "main" ]; then
APP_VERSION=unstable
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SHELL := /bin/bash
# Kubernetes version we pull in as modules and our external API versions.
KUBERNETES_VERSION := $(shell grep 'k8s.io/kubernetes ' go.mod | sed 's/^.* //')

IMAGE_VERSION ?= $(shell git describe --dirty 2> /dev/null || echo v0.0.0-unknown)
IMAGE_VERSION ?= $(shell git describe --tags --dirty 2> /dev/null || echo v0.0.0-unknown)
ifdef IMAGE_REPO
override IMAGE_REPO := $(IMAGE_REPO)/
endif
Expand Down
2 changes: 1 addition & 1 deletion deployment/operator/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SHELL := /bin/bash

# Default image version (tag) and image save path.
IMAGE_VERSION ?= $(shell git describe --dirty 2> /dev/null)
IMAGE_VERSION ?= $(shell git describe --tags --dirty 2> /dev/null)
IMAGE_PATH ?= .

# CHANNELS define the bundle channels used in the bundle.
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/update-gh-pages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ fi
#
# Update gh-pages branch
#
commit_hash=`git describe --dirty --always`
commit_hash=`git describe --tags --dirty --always`

# Switch to work in the gh-pages worktree
pushd "$build_dir"
Expand Down

0 comments on commit ae97c82

Please sign in to comment.