-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
32 lines (28 loc) · 999 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
BUILDTIME ?= $(shell date '+%Y-%m-%d@%H:%M:%S')
BUILDUSER ?= $(shell id -un)
REPO ?= github.com/kobsio/klogs
REVISION ?= $(shell git rev-parse HEAD)
VERSION ?= $(shell git describe --tags)
.PHONY: build-plugin
build-plugin:
@go build -ldflags "-X ${REPO}/pkg/version.Version=${VERSION} \
-X ${REPO}/pkg/version.Revision=${REVISION} \
-X ${REPO}/pkg/version.Branch=${BRANCH} \
-X ${REPO}/pkg/version.BuildUser=${BUILDUSER} \
-X ${REPO}/pkg/version.BuildDate=${BUILDTIME}" \
-buildmode=c-shared -o out_clickhouse.so ./cmd/plugin;
.PHONY: build-ingester
build-ingester:
@go build -ldflags "-X ${REPO}/pkg/version.Version=${VERSION} \
-X ${REPO}/pkg/version.Revision=${REVISION} \
-X ${REPO}/pkg/version.Branch=${BRANCH} \
-X ${REPO}/pkg/version.BuildUser=${BUILDUSER} \
-X ${REPO}/pkg/version.BuildDate=${BUILDTIME}" \
-o ingester ./cmd/ingester;
.PHONY: vet
vet:
@go vet ./...
.PHONY: test
test:
@go test ./...