Skip to content

Commit

Permalink
Allow setting custom version but use git by default
Browse files Browse the repository at this point in the history
Makefile: Allow using `VERSION` to provide a version override when building the project.
This allows for building using a tarball, without requiring git.
  • Loading branch information
dvzrv committed Apr 18, 2023
1 parent 47fc009 commit 664ef74
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ endif
PROJECT := github.com/kubernetes-sigs/cri-tools
BINDIR ?= /usr/local/bin

VERSION := $(shell git describe --tags --dirty --always)
VERSION := $(VERSION:v%=%)
VERSION ?= $(shell git describe --tags --dirty --always | sed 's/^v//')
GO_LDFLAGS := -X $(PROJECT)/pkg/version.Version=$(VERSION)

BUILD_PATH := $(shell pwd)/build
Expand Down

0 comments on commit 664ef74

Please sign in to comment.