mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 03:34:18 +02:00
Refactor output code, add JSON, TSV and YAML output modes, add -o (#19), add version subcommand
This commit is contained in:
15
Makefile
15
Makefile
@@ -23,11 +23,24 @@ UID = root
|
||||
GID = 0
|
||||
HAVE_POD := $(shell pod2text -h 2>/dev/null)
|
||||
|
||||
BRANCH = $(shell git branch --show-current)
|
||||
COMMIT = $(shell git rev-parse --short=8 HEAD)
|
||||
BUILD = $(shell date +%Y.%m.%d.%H%M%S)
|
||||
GOVERSION = $(shell grep -E "^go" go.mod | cut -d' ' -f2)
|
||||
APIVERSION = $(shell grep github.com/elastic/go-elasticsearch go.mod | cut -d' ' -f2)
|
||||
|
||||
|
||||
all: buildlocal
|
||||
|
||||
|
||||
buildlocal:
|
||||
CGO_LDFLAGS='-static' go build -tags osusergo,netgo -ldflags "-extldflags=-static" -o $(tool)
|
||||
CGO_LDFLAGS='-static' go build -tags osusergo,netgo -ldflags "-extldflags=-static" \
|
||||
-ldflags "-X codeberg.org/scip/esctl/pkg/cfg.BRANCH=$(BRANCH) \
|
||||
-X codeberg.org/scip/esctl/pkg/cfg.COMMIT=$(COMMIT) \
|
||||
-X codeberg.org/scip/esctl/pkg/cfg.GOVERSION=$(GOVERSION) \
|
||||
-X codeberg.org/scip/esctl/pkg/cfg.APIVERSION=$(APIVERSION) \
|
||||
-X codeberg.org/scip/esctl/pkg/cfg.BUILD=$(BUILD)" \
|
||||
-o $(tool)
|
||||
strip $(tool)
|
||||
|
||||
install: buildlocal
|
||||
|
||||
Reference in New Issue
Block a user