forked from googlearchive/pubsubbeat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (35 loc) · 905 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
33
34
35
36
37
38
39
40
41
42
43
44
45
BEAT_NAME=pubsubbeat
BUILD_DIR=bin
BEAT_PATH=github.com/GoogleCloudPlatform/pubsubbeat
NOW ?= $(shell date --iso-8601=seconds)
COMMIT_ID ?= $(shell git rev-parse HEAD)
VERSION_LDFLAGS := \
-X github.com/elastic/beats/libbeat/version.buildTime=$(NOW) \
-X github.com/elastic/beats/libbeat/version.commit=$(COMMIT_ID)
GOBUILD_FLAGS=-ldflags "$(VERSION_LDFLAGS)"
.PHONY: build
build:
go build -o ${BEAT_NAME} ${GOBUILD_FLAGS}
.PHONY: pre-commit
pre-commit: clean fmt vet update test
.PHONY: clean
clean:
rm -rf ${BUILD_DIR}
rm -f ${BEAT_NAME}
.PHONY: test
test:
go test ./...
.PHONY: fmt
fmt:
gofmt -s -w $(shell find . -type f -name '*.go' | grep -v \./vendor/)
.PHONY: vet
vet:
go vet ./...
.PHONY: update
update:
@echo "TODO: update deps"
.PHONY: release
release: dashboards
goreleaser --snapshot --skip-publish --rm-dist
dashboards:
cp -r _meta/kibana dashboards