forked from meroxa/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (36 loc) · 1.16 KB
/
Makefile
File metadata and controls
44 lines (36 loc) · 1.16 KB
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
SHELL = /bin/bash -o pipefail
GIT_COMMIT := $(shell git rev-parse --short HEAD)
LDFLAGS := -X main.GitCommit=${GIT_COMMIT}
GIT_UNTRACKED = $(shell git diff-index --quiet HEAD -- || echo "(updated)")
LDFLAGS += -X main.GitUntracked=${GIT_UNTRACKED}
GIT_TAG = $(shell git describe)
LDFLAGS += -X main.GitLatestTag=${GIT_TAG}
REBUILD_DOCS ?= "true"
.PHONY: build
build: docs
go build -mod=vendor -o meroxa cmd/meroxa/main.go
.PHONY: install
install:
go build -ldflags "$(LDFLAGS)" -o $$(go env GOPATH)/bin/meroxa cmd/meroxa/main.go
.PHONY: gomod
gomod:
go mod tidy && go mod vendor
.PHONY: test
test:
go test -v ${GO_TEST_FLAGS} -count=1 -timeout 5m ./...
.PHONY: docs
ifeq ($(REBUILD_DOCS), "true")
docs:
rm -rf docs/cmd && mkdir -p docs/cmd/{md,www}
rm -rf etc && mkdir -p etc/man/man1 && mkdir -p etc/completion
go run gen-docs/main.go
endif
.PHONY: fig
fig:
go run gen-spec/main.go
.PHONY: lint
lint:
docker run --rm -v $(CURDIR):/app -w /app golangci/golangci-lint:latest golangci-lint run --timeout 5m -v
.PHONY: mock
mock:
mockgen -source cmd/meroxa/turbine/interface.go -package mock > cmd/meroxa/turbine/mock/cli.go