-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Used govvv for build time information Signed-off-by: Barun Acharya <barun.acharya@accuknox.com>
- Loading branch information
1 parent
9b8dd0e
commit 1d41ba9
Showing
2 changed files
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
CURDIR=$(shell pwd) | ||
VERSION=$(shell git describe --tags --dirty --always) | ||
|
||
ifeq (,$(shell which govvv)) | ||
$(shell go install github.com/ahmetb/govvv@latest) | ||
endif | ||
|
||
PKG := $(shell go list ./version) | ||
GIT_INFO := $(shell govvv -flags -pkg $(PKG)) | ||
|
||
.PHONY: build | ||
build: | ||
cd $(CURDIR) | ||
go mod tidy | ||
CGO_ENABLED=0 go build \ | ||
-ldflags "-w -s -X github.com/kubearmor/kubearmor-client/version.version=${VERSION}" \ | ||
-ldflags "-w -s ${GIT_INFO}" \ | ||
-o karmor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters