Skip to content

Commit

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

all: help

Expand Down Expand Up @@ -56,8 +57,8 @@ test: clean-cov fmt vet $(GINKGO)
## install: Build and install kuadrantctl binary ($GOBIN or GOPATH/bin)
.PHONY : install
install: fmt vet
ifneq ($(VERSION),)
GOBIN=$(PROJECT_PATH)/bin $(GO) install -ldflags "-X 'github.com/kuadrant/kuadrantctl/version.Version=dev - $(VERSION)'"
ifneq ($(VERSION),$(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
GOBIN=$(PROJECT_PATH)/bin $(GO) install
endif
Expand Down

0 comments on commit fe14ab3

Please sign in to comment.