forked from jrnd-io/jr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (38 loc) · 990 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
46
47
48
49
50
51
52
53
VERSION=0.2.2
USER=$(shell id -u -n)
TIME=$(shell date)
hello:
@echo "JR,the JSON Random Generator"
generate:
go install github.com/actgardner/gogen-avro/v10/cmd/...@latest
go generate pkg/types/generate.go
compile:
@echo "Compiling"
go build -v -ldflags="-X 'github.com/ugol/jr/cmd.Version=$(VERSION)' -X 'github.com/ugol/jr/cmd.BuildUser=$(USER)' -X 'github.com/ugol/jr/cmd.BuildTime=$(TIME)'" -o build/jr jr.go
run: compile
./build/jr
clean:
go clean
rm build/*
test:
go test ./...
test_coverage:
go test ./... -coverprofile=coverage.out
dep:
go mod download
vet:
go vet
lint:
golangci-lint run --enable-all
help: hello
@echo ''
@echo 'Usage:'
@echo ' ${YELLOW}make${RESET} ${GREEN}all${RESET}'
@echo ''
copy_templates:
mkdir -p ~/.jr/kafka && cp -r templates ~/.jr/ && cp -r pkg/producers/kafka/*.properties.example ~/.jr/kafka/
copy_config:
mkdir -p ~/.jr && cp config/* ~/.jr/
install:
install build/jr /usr/local/bin
all: hello generate compile