mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 17:14:17 +02:00
add API viewer, mv repl subcommand to api (#41)
This commit is contained in:
26
Makefile
26
Makefile
@@ -23,17 +23,27 @@ 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)
|
||||
|
||||
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)
|
||||
APISPEC = "https://www.elastic.co/docs/api/doc/elasticsearch.json"
|
||||
|
||||
all: buildlocal
|
||||
|
||||
|
||||
buildlocal:
|
||||
# pkg/es/openspec.go:
|
||||
# echo "package es" > pkg/es/openspec.go
|
||||
# echo >> pkg/es/openspec.go
|
||||
# echo "const Openspec = \`" >> pkg/es/openspec.go
|
||||
# curl -o - $(APISPEC) | sed "s/\`/'/g" >> pkg/es/openspec.go
|
||||
# echo "\`" >> pkg/es/openspec.go
|
||||
|
||||
assets/openapi.json:
|
||||
curl -o assets/openapi.json $(APISPEC)
|
||||
|
||||
buildlocal: assets/openapi.json
|
||||
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) \
|
||||
@@ -50,7 +60,7 @@ install: buildlocal
|
||||
install -o $(UID) -g $(GID) -m 444 $(tool).1 $(PREFIX)/man/man1/
|
||||
|
||||
clean:
|
||||
rm -rf $(tool) coverage.out testdata t/out
|
||||
rm -rf $(tool) coverage.out testdata t/out pkg/es/openspec.go
|
||||
|
||||
test: clean
|
||||
mkdir -p t/out
|
||||
|
||||
Reference in New Issue
Block a user