Skip to content

Commit

Permalink
moved git hash and dirty variables into install target
Browse files Browse the repository at this point in the history
  • Loading branch information
ehearneRedHat committed Jun 11, 2024
1 parent c76b96e commit 400da84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
PROJECT_PATH := $(patsubst %/,%,$(dir $(MKFILE_PATH)))
GO ?= go
KUADRANT_NAMESPACE=kuadrant-system
GIT_HASH := $(shell git rev-parse --short=7 HEAD)
GIT_DIRTY := $(shell git diff --stat)

all: help

Expand Down Expand Up @@ -57,6 +55,8 @@ test: clean-cov fmt vet $(GINKGO)
## install: Build and install kuadrantctl binary ($GOBIN or GOPATH/bin)
.PHONY : install
install: fmt vet
$(eval GIT_HASH := $(shell git rev-parse --short=7 HEAD))
$(eval GIT_DIRTY := $(shell git diff --stat))
ifneq ($(GIT_HASH),$(GIT_DIRTY))
GOBIN=$(PROJECT_PATH)/bin $(GO) install -ldflags "-X 'github.com/kuadrant/kuadrantctl/version.GitDirty=$(GIT_DIRTY)' -X 'github.com/kuadrant/kuadrantctl/version.GitHash=$(GIT_HASH)'"
else
Expand Down

0 comments on commit 400da84

Please sign in to comment.