Skip to content

Commit

Permalink
added make target for adding git commit hash as version
Browse files Browse the repository at this point in the history
  • Loading branch information
ehearneRedHat committed May 23, 2024
1 parent 115d5a2 commit 337953d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ test: fmt vet $(GINKGO)
## install: Build and install kuadrantctl binary ($GOBIN or GOPATH/bin)
.PHONY : install
install: fmt vet
$(MAKE) update-version
GOBIN=$(PROJECT_PATH)/bin $(GO) install

.PHONY: prepare-local-cluster
Expand Down Expand Up @@ -74,5 +75,10 @@ fmt:
vet:
$(GO) vet ./...

.PHONY: update-version
update-version:
@commit_hash=$$(git rev-parse --short=7 HEAD); \
sed -i.bak 's/Version = "v0.0.0"/Version = "dev - '$${commit_hash}'"/' version/version.go && rm version/version.go.bak

# Include last to avoid changing MAKEFILE_LIST used above
include ./make/*.mk

0 comments on commit 337953d

Please sign in to comment.